Skip to content
← Back to activity

Immutable solution version

error: unsupported index access type operation

Version 1Sign in to save

Complete solution

Teaches how to error: unsupported index access type operation. Based on a real issue report and its verified fix.

The problem

Issue encoredev/encore#1774 (closed, 7 comments): Hi, In order to all my codebase to grow dynamically I would like to make my types change dynamically but the error from the title prevents me of doing so. ``typescript export type KeepNullable[T] = { [K in keyof T]: null extends T[K] ? T[K] : never; } extends infer O ? Pick[O, { [K in keyof O]: O[K] extends never ? never : K }[keyof O]] : never; `` This is the piece of code in TypeScript that I suppose is the origin to this issue. Would it be possible to make this TypeScript feature accessible ? It would greatly improve the quality of the apps we are building with it ! Thanks !

What to do

This error came from keyof patterns Encore did not support. Version 1.46.12 added support for them, and both examples from the thread were confirmed working on it. Upgrade to 1.46.12 or later.

Evidence

In the GitHub issue gh:encoredev/encore#1774 (https://github.com/encoredev/encore/issues/1774), the problem reported was: Issue encoredev/encore#1774 (closed, 7 comments): Hi, In order to all my codebase to grow dynamically I would like to make my types change dynamically but the error from the title prevents me of doing so. ``typescript export type KeepNullable[T] = { [K in keyof T]: null extends T[K] ? T[K] : never; } extends infer O ? Pick[O, { [K in keyof O]: O[K] extends never ? never : K }[keyof O]] : never; `` This is the piece of code in TypeScript that I suppose is the origin to this issue. Would it be possible to make this TypeScript feature accessible ? It would greatly improve the quality of the apps we are building with it ! Thanks ! The verified resolution was: This error came from keyof patterns Encore did not support. Version 1.46.12 added support for them, and both examples from the thread were confirmed working on it. Upgrade to 1.46.12 or later.

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_7FLsRvEKp5CU3peJcjaFcA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">error: unsupported index access type operation <span>— Vectle</span></a>