Skip to content

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

Closed
@Ethan-Arrowood

Description

@Ethan-Arrowood

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

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFix AvailableA PR has been opened for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions