Skip to content
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

Re-exporting class on commonjs - JS code + declaration emit leads to tsc crash #41182

Closed
Bnaya opened this issue Oct 21, 2020 · 1 comment · Fixed by #41190
Closed

Re-exporting class on commonjs - JS code + declaration emit leads to tsc crash #41182

Bnaya opened this issue Oct 21, 2020 · 1 comment · Fixed by #41190
Assignees
Labels
Bug A bug in TypeScript Crash For flagging bugs which are compiler or service crashes or unclean exits, rather than bad output Domain: Declaration Emit The issue relates to the emission of d.ts files Domain: JSDoc Relates to JSDoc parsing and type generation Fix Available A PR has been opened for this issue

Comments

@Bnaya
Copy link

Bnaya commented Oct 21, 2020

TypeScript Version: 4.1.0-dev.20201021

Search Terms:
Unhandled alias declaration kind in symbol serializer

Code
https://gist.github.com/Bnaya/ccb802d892508f3f4ebd81e3350eea05
run yarn tsc4p1

Expected behavior:
Should compile and emit types

Actual behavior:
tsc crash with:

/Users/bnaya/.npm/_npx/16389/lib/node_modules/typescript/lib/tsc.js:86657
                throw e;
                ^

Error: Debug Failure. Unhandled alias declaration kind in symbol serializer!
Node 198 was unexpected.
    at serializeAsAlias (/Users/bnaya/.npm/_npx/16389/lib/node_modules/typescript/lib/tsc.js:40361:45)
    at serializeSymbolWorker (/Users/bnaya/.npm/_npx/16389/lib/node_modules/typescript/lib/tsc.js:40082:25)
    at serializeSymbol (/Users/bnaya/.npm/_npx/16389/lib/node_modules/typescript/lib/tsc.js:39987:38)
    at /Users/bnaya/.npm/_npx/16389/lib/node_modules/typescript/lib/tsc.js:39972:29
    at Map.forEach (<anonymous>)
    at visitSymbolTable (/Users/bnaya/.npm/_npx/16389/lib/node_modules/typescript/lib/tsc.js:39971:81)
    at symbolTableToDeclarationStatements (/Users/bnaya/.npm/_npx/16389/lib/node_modules/typescript/lib/tsc.js:39847:17)
    at /Users/bnaya/.npm/_npx/16389/lib/node_modules/typescript/lib/tsc.js:38395:106
    at withContext (/Users/bnaya/.npm/_npx/16389/lib/node_modules/typescript/lib/tsc.js:38422:37)
    at Object.symbolTableToDeclarationStatements (/Users/bnaya/.npm/_npx/16389/lib/node_modules/typescript/lib/tsc.js:38395:28)
error Command failed with exit code 1.

Related Issues:
#37832

@weswigham weswigham added Bug A bug in TypeScript Crash For flagging bugs which are compiler or service crashes or unclean exits, rather than bad output Domain: Declaration Emit The issue relates to the emission of d.ts files Domain: JSDoc Relates to JSDoc parsing and type generation labels Oct 21, 2020
@weswigham weswigham self-assigned this Oct 21, 2020
@weswigham weswigham added this to the TypeScript 4.1.1 milestone Oct 21, 2020
@Bnaya
Copy link
Author

Bnaya commented Oct 21, 2020

@weswigham can you take a look also on the repro here:
#37832 (comment)
#37832 is not 100% fixed
Thanks! :))

@typescript-bot typescript-bot added the Fix Available A PR has been opened for this issue label Oct 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Crash For flagging bugs which are compiler or service crashes or unclean exits, rather than bad output Domain: Declaration Emit The issue relates to the emission of d.ts files Domain: JSDoc Relates to JSDoc parsing and type generation Fix Available A PR has been opened for this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants