我正在将我的create-react-app转换为Gatsby。为此,我采用了现有项目,并进行了npm install gatsby的安装gatsby-cli
,然后从一个新的Gatsby站点复制了项目结构的更改。然后,我将App.js移至src / pages / index.js。我最终删除了从创建的网站复制的gatsby-config.js,gatsby new
因为我不知道如何安装该gatsby-plugin-react-helmet
插件。我不知道gatsby-config.js指定的插件是否需要使网站正常工作。
该项目使用react-circular-progressbar实现了圆形进度条。尝试使用构建应用程序时gatsby build
,出现以下错误:
Unknown error from PostCSS plugin. Your current PostCSS version is 6.0.23, but autoprefixer uses 7.0.26. Perhaps this is the source of the error below.
ERROR #98123 WEBPACK
Generating development JavaScript bundle failed
Browser queries must be an array or string. Got object.
File: node_modules/react-circular-progressbar/dist/styles.css
我使用更新了PostCSS到7.0.26,npm i postcss
但仍然说我使用的是旧版本。
如果您检出此链接,则会看到此错误。我不确定浏览器查询是什么,但是我检查了错误中引用的styles.css文件,唯一看到的是类样式,然后是该浏览器特定的样式:-webkit-transition: stroke-dashoffset 0.5s ease 0s;
删除此行不能解决问题。
gatsby-config.js
是重要的Gatsby配置文件之一。任何不添加此文件的调试都将毫无希望。
空复制gatsby-config.js
从官方文档并作为描述添加PostCSS插件文件。重新运行npm或yarn。运行gatsby clean
然后gatsby develop
。
该错误很可能是由POSTCSS插件应提供并轻松解决的缺少源文件或配置文件引起的。
您的网站现在可以正常工作吗?
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句