Next.js: TypeScript Server - Cannot read property 'kind' of undefined`

Created on 1 Aug 2020  路  3Comments  路  Source: vercel/next.js

Bug report

Describe the bug

When running next with TypeScript custom server (as in the example app), there is an error
TypeError: Cannot read property 'kind' of undefined

To Reproduce

  1. Run npx create-next-app my-app.
  2. choose Example from the Next.js repo.
  3. select custom-server-typescript and wait for completion.
  4. run dev script yarn dev.

You will see the error in the log:

error - TypeError: Cannot read property 'kind' of undefined

with the stack trace.
Also, if you will navigate to your app in the browser (http://localhost:3000) you will see the same error
and after a while (short noticeable delay), you will see the correct app content.

Expected behavior

No error should be presented

Screenshots

Terminal:

image

Browser:

image

After a while, the browser error disappear

System information

  • OS: Windows
  • Browser (if applies) Chrome
  • Version of Next.js: 9.5.1 (latest)
  • Version of Node.js: 12.16.3

Additional context

It may be a TypeScript issue?

good first issue

Most helpful comment

This is TypeScript issue (#38383) and folks suggested to downgrade typescript v3.8.3 to temporary fix this issue until TypeScript releases new patch.

All 3 comments

This is TypeScript issue (#38383) and folks suggested to downgrade typescript v3.8.3 to temporary fix this issue until TypeScript releases new patch.

Closed by #15833 (temporary solution to use TypeScript v3.8.3 until TypeScript will fix their issue).

You can also install version ^4.0.2, the problem is also fixed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pie6k picture pie6k  路  3Comments

formula349 picture formula349  路  3Comments

timneutkens picture timneutkens  路  3Comments

knipferrc picture knipferrc  路  3Comments

kenji4569 picture kenji4569  路  3Comments