New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: Cannot read properties of undefined (reading 'get') at getTypeAliasInstantiation #53287
Comments
…caused the build to silently fail This caused that Babel transpiled the code but no type checking ever failed, which meant we were basically just writing JavaScript with TypeScript syntax ref microsoft/TypeScript#53287
…caused the build to silently fail (#878) This caused that Babel transpiled the code but no type checking ever failed, which meant we were basically just writing JavaScript with TypeScript syntax ref microsoft/TypeScript#53287
As far as I can tell this is related to #49458 also |
Compiler test // @strict: true
// @skipLibCheck: false
// @skipDefaultLibCheck: true
// @filename: node_modules/package/source.d.ts
export interface SourceType<A = any> { }
// @filename: node_modules/package/subuser.d.ts
import { UserType } from './user';
import { SourceType } from './index';
export class SubUser extends UserType {
doSomething(client: SourceType): void;
}
// @filename: node_modules/package/user.d.ts
import { SourceType } from './source';
export type Manipulation<T> = T extends Array<infer U> ? U : never;
export declare class UserType {
doSomething(client: SourceType<Manipulation<any>>): void;
}
// @filename: node_modules/package/index.d.ts
export { type SourceType } from "./source"
export { type SubUser } from "./subuser"
// @filename: index.ts
import { SourceType } from "package"
declare module "package" {
type SourceType = string;
} |
@iisaduan When will this merged? I am having the same issue and I cannot build my app it always fails with: /backend:build: TypeError: Cannot read properties of undefined (reading 'get')
/backend:build: at getTypeAliasInstantiation (/Users/xxxx/Code/github/lumoflo/node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/tsc.js:55837:46) |
@imprakharshukla , Working on it! If you would like to see if the fix works for you, you can try it: #58326 (comment) |
@imprakharshukla If you're hitting this in your codebase, it is likely because there is a symbol merge that shouldn't have previously been allowed in your code. The new version should help point out where the issue is. |
Bug Report
🔎 Search Terms
getTypeAliasInstantiation, (reading 'get'), TypeError: Cannot read properties of undefined, createMarkerType
🕗 Version & Regression Information
We have only now figured out something went wrong as we used babel to transpile and fork-ts-checker-webpack-plugin to type check. This caused the type checking to silently fail, which has caused a few bugs lately.
⏯ Playground Link
I don't have a Playground Link as I have no clue what causes it. But the repository is public:
https://github.com/wepublish/wepublish/tree/8e4198788c2d60aa5f03869a6fdf9bda2566b45f
The command needed to reproduce it:
npm i && npx tsc -p ./apps/editor/tsconfig.app.json
If typescript version is set to
~4.6.0
everything works. If typescript is set to 4.7 or above, it fails💻 Code
I haven't been able to produce a minimal reproduction.
🙁 Actual behavior
TSC crashes with an error thrown:
🙂 Expected behavior
TypeScript does not crash and returns the relevant errors
The text was updated successfully, but these errors were encountered: