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

Generating types results in "Cannot read property 'kind' of undefined" error #40554

Closed
Ethan-Arrowood opened this issue Sep 14, 2020 · 1 comment · Fixed by #40596
Closed
Assignees
Labels
Bug A bug in TypeScript Fix Available A PR has been opened for this issue

Comments

@Ethan-Arrowood
Copy link

I'm testing out the capabilities of Creating .d.ts files from .js files with the fastify project.

We ship our own, hand written types at Fastify under the types directory as well as the fastify.d.ts root file. The testing im doing here is meant to ignore all of that and just see what the TSC compiler can generate for us.

I'm using the command (from a clean master branch and renaming the existing fastify.d.ts file to _fastify.d.ts):

npx typescript@next fastify.js --declaration --allowJs --emitDeclarationOnly --outDir types2

Which results in:

npx: installed 1 in 2.449s
Cannot read property 'kind' of undefined

It does not generate a fastify.d.ts file, but does generate matching type definitions for all of our core deps found in lib.

Would be interested in why this error is being returned and how we could fix it.

TypeScript Version: npx typescript@next

Search Terms:

"Cannot read property 'kind' of undefined"

Code

clean master branch and renaming the existing fastify.d.ts file to _fastify.d.ts

Expected behavior:

A fastify.d.ts file to generated

Actual behavior:

A lib directory is generated in the types2 directory and the Cannot read property 'kind' of undefined is returned in the console.

Related Issues:
#38383

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Fix Available A PR has been opened for this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants