Error: The 'decorators' plugin requires a 'decoratorsBeforeExport' option

Posted renyunbo

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Error: The 'decorators' plugin requires a 'decoratorsBeforeExport' option相关的知识,希望对你有一定的参考价值。

Error: The ‘decorators’ plugin requires a ‘decoratorsBeforeExport’ option, whose value must be a boolean. If you are migrating from Babylon/Babel 6 or want to use the old decorators proposal, you should use the ‘decorators-legacy’ plugin instead of ‘decorators’ 背景:react 项目 + babel 7 + 使用到装饰器 错误 使用以上装饰器时,需安装相应的插件和配置某些文件,否则可能会出现以下错误 解决办法 步骤如下: 1、安装以下插件 npm install -D @babel/plugin-proposal-decorators 1 2、配置.babelrc 文件或package.json文件的 babel 字段值(两者二选一,不要都配置,否者会报找到两个配置文件的错) (1)配置 .babelrc 文件 "plugins": [ ["@babel/plugin-proposal-decorators", "legacy": true ], ] 1 2 3 (2)配置 package.json 文件的 babel 字段值 babel: "plugins": [ ["@babel/plugin-proposal-decorators", "legacy": true ], ] 1 2 3 4 5 参考文章 ‘decorators-legacy’ issue --------------------- 作者:Deng冬 来源:CSDN 原文:https://blog.csdn.net/dengdongxia/article/details/86819496 版权声明:本文为博主原创文章,转载请附上博文链接!

以上是关于Error: The 'decorators' plugin requires a 'decoratorsBeforeExport' option的主要内容,如果未能解决你的问题,请参考以下文章

Support for the experimental syntax 'decorators-legacy' isn't currently enabled (7:1):(示

react+mobx+antd按需加载 出现Support for the experimental syntax 'decorators-legacy' isn't curr

遇到 Error creating the Web Proxy specified in the 'system.net/defaultProxy' configuration sec

2019-07-24 运行报错Parsing error: The keyword 'import' is reserved

-- Could not find the required component 'pcl_ros'. The following CMake error indicates that

Springdata mongodb 版本兼容 引起 Error [The 'cursor' option is required, except for aggregate with