Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

npm run start 项目运行报错 #385

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

violetjack
Copy link

当我通过 README 来创建项目并运行的时候,报 babel 错误。

$ yarn global add gatsby-cli
$ gatsby new mysite https://github.com/antvis/gatsby-starter-theme-antv
$ cd mysite
$ yarn start

"@antv/gatsby-theme-antv" threw an error while running the createPages lifecycle:
Error: [BABEL] /C:/Users/violetjack/github/G2-4/examples/bar/basic/demo/bsic.ts: The decorators plugin, when .version is '2018-09' or not specified, requires a 'decoratorsBeforeExport' option, whose value must be a boolean. (While pro cessing: "base3333$inherits")

查了源码发现是 @babel/standalone 中的 stage-3 这个 preset 里面用到了 @babel/plugin-proposal-decorators,它的配置引起了报错。

详见 掘金文章

"@antv/gatsby-theme-antv" threw an error while running the createPages lifecycle:
Error: [BABEL] /C:/Users/violetjack/github/G2-4/examples/bar/basic/demo/bsic.ts: The decorators plugin, when .version is '2018-09' or not specified, requires a 'decoratorsBeforeExport' option, whose value must be a boolean. (While pro cessing: "base3333$inherits")
@github-actions
Copy link

⚡️ Deploying PR Preview...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant