当我npm run build
在我的create-react-app项目中做时,它失败并且登录不是很有帮助。
这里 -> npm 日志的图像
这是文本格式的问题。
> react-scripts build
Creating an optimized production build...
Failed to compile.
Cannot read property 'type' of undefined
CompileError: Begins at CSS selector undefined
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! card_builder@0.1.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the card_builder@0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in
我的应用程序在开发模式下运行良好(即在npm start
)
这是代码沙箱网址的链接-> https://codesandbox.io/s/cant-read-propery-type-of-undefined-problem-with-react-scripts-build-6riyp
使用 create-react-app 构建