-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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 property 'set' of undefined at Object.trackReferencedAmbientModule #25714
Comments
We will need some code sample to be able to act on this. under the debugger, a |
I was able to make a minimal repro case. The code is below; I'll also attach it as a zip file.
Zip file: |
I also stumbled across this really bizarre line in a generated
Funny 😃 I love the The above declaration was generated for the following TypeScript code:
|
Hi @mhegazy , I just wanted to make sure that my comments above don't slip through the cracks. (I know it was only yesterday that I commented, but I get the impression you folks are deep into the 3.0 release process right now.) I posted a nice small repro case for this issue, and it's preventing us from upgrading to 2.9.x or 3.0.x (I don't know what changes I would need to make to my code to work around it). Thanks! |
Your compiler options and repro are much appreciated ❤️ #25982 is up with the (very tiny) fix! |
I am getting the exception below when running
tsc
on a project. Unfortunately I cant seem to create a minimal example to reproduce it, but looking through the source oftsc
, there seems to be a case where refs is undefined here: https://github.com/Microsoft/TypeScript/blob/831be5d0788467f7fe5d708f0d404661b82e5462/src/compiler/transformers/declarations.ts#L78TypeScript Version: 2.9.2 seems to still happen with typescript@next
Search Terms:
Object.trackReferencedAmbientModule
Cannot read property 'set' of undefined
Code
I can't seem to create a reproducable example, and cannot upload the code causing the error as its proprietary.
Expected behavior: should compile correctly
Actual behavior:
Exeception thrown:
TypeError: Cannot read property 'set' of undefined at Object.trackReferencedAmbientModule (***/node_modules/typescript/lib/tsc.js:57838:18) at getNameOfSymbolAsWritten (***/node_modules/typescript/lib/tsc.js:24622:53) at symbolToTypeNode (***/node_modules/typescript/lib/tsc.js:24412:32) at typeToTypeNodeHelper (***/node_modules/typescript/lib/tsc.js:23908:28) at symbolToParameterDeclaration (***/node_modules/typescript/lib/tsc.js:24316:41) at ***/node_modules/typescript/lib/tsc.js:24256:89 at Array.map (<anonymous>) at signatureToSignatureDeclarationHelper (***/node_modules/typescript/lib/tsc.js:24256:55) at createTypeNodeFromObjectType (***/node_modules/typescript/lib/tsc.js:24030:49) at createAnonymousTypeNode (***/node_modules/typescript/lib/tsc.js:23997:42)
Playground Link:
Related Issues:
The text was updated successfully, but these errors were encountered: