这两天忽然报错“”# Cannot find package '@babel/plugin-proposal-class-properties' imported from /MyProject/babel-virtual-resolve-base.js”
问题场景
原来代码中该库是通过.babelrc引入的
"plugins": [
["@babel/plugin-proposal-class-properties"]
]
但是这两天忽然就报错了,本地也没啥问题。就是测试环境报错了。
解决方案
具体原因不知道,但是官方github问题库里面给出了答案。 github.com/babel/babel…
就是把这个依赖包@babel/plugin-proposal-class-properties直接npm install 到package.json里面
问题百宝箱
下面是babel的社区,里面查找问题相关问题简直太方便了
If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite.