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
Unsupported: TypeScript 3.8 Syntax: import type #11909
Comments
Babel has already landed support for this with babel/babel#11171 Work in eslint is ongoing typescript-eslint/typescript-eslint#1436 As next uses babel I would have thought this would have been sorted. However, it seems that next is pinned to v7.0.0 of babel — https://github.com/zeit/next.js/blob/92dac596304a3a04c97a7ce40eea722880c79e89/package.json#L55 — which isn't https://github.com/babel/babel/releases/tag/v7.9.2 (bugfix on v7.9.0) or https://github.com/babel/babel/releases/tag/v7.9.0 (initial support) |
This has been fixed by us upgrading Babel. See https://github.com/vercel/next.js/tree/canary/examples/with-typescript-types |
Heads up, I'm still unable to use the |
I'm experiencing the same as @tamj0rd2 when using Next.js 9.4.4 and Typescript 3.9.6 |
Really strange. I hit the same issue, but... I just cannot figure where it comes from. |
After some hours (like many hours), I just tried the with-typescript-types exemple in the Next repo. At first I though it worked because Yes, I could have avoided this wasted half a day of investigation if I had read this thread more carefully and noticed the problem was experienced when building, but it was the nth I read 😩, and since the issue was closed, I didn't gave it enough attention. @Timer, could you reopen it? Babel upgraded or not, it is not fixed yet. |
This comment has been minimized.
This comment has been minimized.
I think I found the cause: Support for However, Probably this version would need to be bumped for it to work CC @Timer |
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Bug report
Describe the bug
Using the
import type
syntax from TypeScript 3.8 causes a build failure with next.jsTo Reproduce
git clone https://github.com/balupton/nextjs-typescript-3.8-syntax
(applies this changeset balupton/nextjs-typescript-3.8-syntax@53a7fc6 to thewith-javascript
next.js example)cd nextjs-typescript-3.8-syntax
yarn install
yarn build
Expected behavior
It to work fine
Screenshots
System information
Darwin bevrymemacbook.local 19.4.0 Darwin Kernel Version 19.4.0: Wed Mar 4 22:28:40 PST 2020; root:xnu-6153.101.6~15/RELEASE_X86_64 x86_64
Additional context
n/a
The text was updated successfully, but these errors were encountered: