6

I am getting below error from next js app suddenly. Any solution to fix that problem?

./pages/_app.tsx Error: [BABEL] C:\Projects\skribeNew\app-web\pages\_app.tsx: You gave us a visitor for the node type TSSatisfiesExpression but it's not a valid type at verify (C:\Projects\skribeNew\app-web\node_modules\next\dist\compiled\babel\bundle.js:1910:397612) at Function.explode (C:\Projects\skribeNew\app-web\node_modules\next\dist\compiled\babel\bundle.js:1910:396515) at C:\Projects\skribeNew\app-web\node_modules\next\dist\compiled\babel\bundle.js:1:49254 at Generator.next (<anonymous>) at Function.<anonymous> (C:\Projects\skribeNew\app-web\node_modules\next\dist\compiled\babel\bundle.js:1:79767) at Generator.next (<anonymous>) at evaluateSync (C:\Projects\skribeNew\app-web\node_modules\next\dist\compiled\babel\bundle.js:1910:717268) at Function.sync (C:\Projects\skribeNew\app-web\node_modules\next\dist\compiled\babel\bundle.js:1910:715284) at sync (C:\Projects\skribeNew\app-web\node_modules\next\dist\compiled\babel\bundle.js:1:80263) at sync (C:\Projects\skribeNew\app-web\node_modules\next\dist\compiled\babel\bundle.js:1910:716601) 

I changed the babel types version to previous one, But it did not work.

3

4 Answers 4

5

It was because of an incompatible version issue for the npm package "@babel/plugin-transform-typescript". I fixed to the correct previous version in package.json file. Now it's working fine. Below is the code -

"devDependencies": { "@babel/plugin-transform-typescript": "7.19.3", } "resolutions": { "@babel/plugin-transform-typescript": "7.19.3" }

Sign up to request clarification or add additional context in comments.

2 Comments

I encountered the same thing. Due to having a ^ set for the version of @babel/preset-typescript, @babel/plugin-transform-typescript got bumped to 7.20.0. Manually specifying @babel/plugin-transform-typescript": "7.19.3" resolved the issue.
Please do not post your Fiverr, Upwork or any other paid ressources on Stack Overflow.
0
npm i --save --legacy-peer-deps 

1 Comment

While this code may answer the question, providing additional context regarding how and/or why it solves the problem would improve the answer's long-term value. You can find more information on how to write good answers in the help center: stackoverflow.com/help/how-to-answer . Good luck
0

To fix the Webpack build error caused by cssnano during CSS optimization, you can temporarily disable minimization.

Add this to your next.config.ts

webpack: (config) => { config.optimization.minimize = false; return config; }, 

This resolved the issue for me, but it’s only a temporary fix.

Comments

-1

I believe I was having the same issue you are currently experiencing not too long ago. My solution came from reorganizing the path that my node files were installed. I installed my node files to a greater hierarchy in the path then created a new folder down the line to hold my project files so that the files were already somewhere in the path. Alternatively, you could try installing globally with npm install -g yarn

Hope this helps! :)

1 Comment

Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.