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
Babel error causing builds to fail #37080
Comments
For me the error was caused by |
Encountered this as well. Friday morning Babel released version 7.18.0. That comes with a new typescript feature support (babel/babel#14322, babel/babel#14457) that comes with a new TS 4.7 feature (https://devblogs.microsoft.com/typescript/announcing-typescript-4-7-rc/#instantiation-expressions). Newly created projects started using that version but Next's built-in Babel does not support that new feature, hence the error Solution in my case was to use the yarn |
Updated my babel packages to
I saw that |
none of these resolutions worked for me 😢 My package.json:
somebody can help? |
@GiovaniBiagi check your package-lock.json or yarn.lock file for peer dependences, doa find for |
I tried adding overrides to my package.json but that didn't help. Am I using overrides correctly?
|
are you deleting your |
yes I am. |
Please put a print fo you error and your |
It work for me.
|
For npm, it worked for me:
|
This should be fixed in
|
Still having this issue with deleting @babel/types from yarn.lock didn't help Error message:
|
@ElijahKaftanov Could you share a repository that shows the bug? It's quite hard to understand where this comes from; those versions look correct. |
FWIW I'm getting the same issue as @ElijahKaftanov with those versions of dependencies and deleting |
"dependencies": {
"next": "^12.1.6",
},
"devDependencies": {
"@babel/core": "^7.15.0",
"@babel/preset-env": "^7.15.0",
"@babel/preset-react": "^7.15.0",
"@babel/preset-typescript": "^7.15.0",
},
"overrides": {
"@babel/core": "7.15.0",
"@babel/types": "7.15.0"
} still error here.... fixed, overrides all babel package version 7.15.0 |
still error |
Can someone of you which still sees the error after the updates share your lockfile? It might contain some hints to find the problem. Or even better, share a repository that shows the bug. |
Thanks @vithushan19 for the example, i'm also experiencing this error :( I thought it was some conflict with other libs but i made a test deleting everything and installing babel from scratch on my nextjs project and the error still occurs... I don't know if this information is useful, but when i deleted the @babel/preset-typescript from the array of presets inside my .babelrc file, everything worked fine! |
I opened babel/babel#14610 to fix this. Unfortunately the only workaround until that PR is merged&released is to pin |
I am releasing The problem was that we were running some feature detection in the plugin to see which |
This issue has been automatically closed because it received no activity for a month and had no reproduction to investigate. If you think it was closed by accident, please leave a comment. If you are running into a similar issue, please open a new issue with a reproduction. Thank you. |
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Verify canary release
Provide environment information
warn - Latest canary version not detected, detected: "12.1.7-canary.10", newest: "12.1.7-canary.9".
Please try the latest canary version (
npm install next@canary
) to confirm the issue still exists before creating a new issue.Read more - https://nextjs.org/docs/messages/opening-an-issue
What browser are you using? (if relevant)
Chrome
How are you deploying your application? (if relevant)
next run build
Describe the Bug
My deployments are failing on vercel, and when I locally run
npm run build
I get the following error:Error: [BABEL] /Users/mathchamp/Documents/GitHub/skillify-web/pages/_document.tsx: You gave us a visitor for the node type TSInstantiationExpression but it's not a valid type
Upon research, I think something with the latest version of babel is causing these errors.
Expected Behavior
Builds should pass with
npm run build
To Reproduce
Run
npm run build
on the latest version of next.jsBuilds that were passing yesterday are now failing.
The text was updated successfully, but these errors were encountered: