gpt4 book ai didi

javascript - Now.sh 构建因 : Support for the experimental syntax 'decorators-legacy' isn't currently enabled 而中断

转载 作者:行者123 更新时间:2023-12-03 00:20:30 26 4
gpt4 key购买 nike

预期:

在我的tsconfig.js中添加decko(对装饰器的支持)以及添加对experimetalDecorators的支持并使用@之后package.json 中的 babel/plugin-proposal-decorators

我的now.sh创建 PR 后,构建应该可以正常构建和部署,因为该应用程序在本地完美运行。

结果:

构建实际上因以下错误而中断:

enter image description here

Support for the experimental syntax 'decorators-legacy' isn't currently enabled

公关: https://github.com/Futuratum/moonholdings.io/pull/27

构建: https://zeit.co/leongaban/moonholdings/9aacr3qhs


我实际上在本地遇到了同样的错误,但是我通过添加 @babel/plugin-proposal-decorators 包并更新我的 package.json 来修复它,如下所示:

"babel": {
"env": {
"development": {
"presets": [
"next/babel"
],
"plugins": [
[
"styled-components",
{
"ssr": true,
"displayName": true
}
],
[
"@babel/plugin-proposal-decorators",
{
"legacy": true
}
]
]
},

我还尝试将 babel 配置移到 .bablerc 文件中,但我的构建仍然失败。

enter image description here

最佳答案

Next.JS NX 用户请注意,目前有一个开放的 (12/2020) issue对于此错误,请在其 github 上查看:github.com/nrwl/nx/issues/3322

我尝试结合使用多种解决方案来解决此问题,但尚未成功。

关于javascript - Now.sh 构建因 : Support for the experimental syntax 'decorators-legacy' isn't currently enabled 而中断,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54332378/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com