由于 webpack 错误,构建失败

2024-03-13

我突然从下一个 js 应用程序收到以下错误。有什么办法可以解决这个问题吗?

./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)

我将 babel types 版本更改为以前的版本,但它不起作用。


这是因为 npm 包“@babel/plugin-transform-typescript”的版本不兼容问题。我已修复为正确的上一个 package.json 文件中的版本。现在一切正常。下面是代码 -

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

如果答案有帮助,请点赞并标记为已接受。

我的 Fiverr 和 Upwork 个人资料: https://www. Fiverr.com/nizam5567 https://www.fiverr.com/nizam5567 https://www.upwork.com/freelancers/nizamuddin https://www.upwork.com/freelancers/nizamuddin

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

由于 webpack 错误,构建失败 的相关文章

随机推荐