【发布时间】:2019-04-10 15:49:26
【问题描述】:
我使用 create-react-app 创建了一个应用,但在尝试构建生产优化版本 yarn build 时遇到错误:
> yarn build help
yarn run v1.9.4
$ react-scripts build help
Creating an optimized production build...
Failed to compile.
Expected a pseudo-class or pseudo-element.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
不幸的是,这不是一个非常有用的错误。谷歌搜索似乎找到了关于 postcss 的东西,但我不确定这与 create-react-app 有什么关系,或者如何解决这个问题。
以前有没有人遇到过类似的问题?
请注意,该应用在开发模式下可以正常编译:
Compiled successfully!
You can now view note-app in the browser.
Local: http://localhost:3000/
On Your Network: http://192.168.0.54:3000/
Note that the development build is not optimized.
To create a production build, use yarn build.
【问题讨论】:
-
我被同样的问题困扰了一段时间。找不到解决办法。
-
你发现了吗?我在使用 Vue 的
electron-builder插件时遇到了同样的问题