When running next with TypeScript custom server (as in the example app), there is an error
TypeError: Cannot read property 'kind' of undefined
npx create-next-app my-app.Example from the Next.js repo.custom-server-typescript and wait for completion.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.
No error should be presented
Terminal:

Browser:

After a while, the browser error disappear
It may be a TypeScript issue?
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.
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.