Gatsby: WebpackError: Invariant Violation: Minified React error #62

创建于 2019-01-26  ·  1评论  ·  资料来源: gatsbyjs/gatsby

为了让我们更容易为您提供帮助,请提供尽可能多的有用信息。 有用链接: - 文档:https://www.gatsbyjs.org/docs/ Gatsby 有多个社区支持渠道,请尝试在以下位置提问: - Discord:https://gatsby.app/discord - Spectrum:https://频谱.chat/gatsby-js - Twitter: https://twitter.com/gatsbyjs 在打开新问题之前,请搜索现有问题 https://github.com/gatsbyjs/gatsby/issues

概括

Gatsby build抛出WebpackError: Invariant Violation: Minified React error #62错误,gatsby develop 工作没有问题,即使是艰难的gatsby develop works fine

相关信息

error Building static HTML for pages failed

See our docs page on debugging HTML builds for help https://gatsby.app/debug-html

   8 |  else
   9 |          root["lib"] = factory(root["@reach/router"], root["core-js/modules/es6.array.iterator"], root["core-js/modules/es6.array.sort"], root["core-js/modules/es6.function.name"], root["core-js/modules/es6.map"], root["core-js/modules/es6.object.assign"], root["core-js/modules/es6.regexp.constructor"], root["core-js/modules/es6.regexp.split"], root["core-js/modules/es6.regexp.to-string"], root["core-js/modules/es6.string.ends-with"], root["core-js/modules/es6.string.iterator"], root["core-js/modules/web.dom.iterable"], root["fs"], root["lodash"], root["path"], root["react"], root["react-dom/server"], root["react-helmet"]);
> 10 | })(this, function(__WEBPACK_EXTERNAL_MODULE__reach_router__, __WEBPACK_EXTERNAL_MODULE_core_js_modules_es6_array_iterator__, __WEBPACK_EXTERNAL_MODULE_core_js_modules_es6_array_sort__, __WEBPACK_EXTERNAL_MODULE_core_js_modules_es6_function_name__, __WEBPACK_EXTERNAL_MODULE_core_js_modules_es6_map__, __WEBPACK_EXTERNAL_MODULE_core_js_modules_es6_object_assign__, __WEBPACK_EXTERNAL_MODULE_core_js_modules_es6_regexp_constructor__, __WEBPACK_EXTERNAL_MODULE_core_js_modules_es6_regexp_split__, __WEBPACK_EXTERNAL_MODULE_core_js_modules_es6_regexp_to_string__, __WEBPACK_EXTERNAL_MODULE_core_js_modules_es6_string_ends_with__, __WEBPACK_EXTERNAL_MODULE_core_js_modules_es6_string_iterator__, __WEBPACK_EXTERNAL_MODULE_core_js_modules_web_dom_iterable__, __WEBPACK_EXTERNAL_MODULE_fs__, __WEBPACK_EXTERNAL_MODULE_lodash__, __WEBPACK_EXTERNAL_MODULE_path__, __WEBPACK_EXTERNAL_MODULE_react__, __WEBPACK_EXTERNAL_MODULE_react_dom_server__, __WEBPACK_EXTERNAL_MODULE_react_helmet__) {
     |  ^
  11 | return


  WebpackError: Invariant Violation: Minified React error #62; visit https://reactjs.org/docs/error-decoder.html?invariant=62&args[]= for the full message  or use the non-minified dev environment for full errors and additional helpful warnings.

这是我收到的完整错误消息。 我已经尝试消除所有错误的样式属性映射,如完整的 React 错误消息中所述,但问题仍然存在。 我也删除了.cache

我不知道还有什么问题,因为我可以更早地进行成功构建,并且该消息没有提供有关我的代码可能有什么问题的更多见解,尤其是因为我可以使用gatsby develop完美运行它

环境(如果相关)

``
系统:
操作系统:macOS 10.14.2
CPU:(8) x64 Intel(R) Core(TM) i7-4750HQ CPU @ 2.00GHz
外壳:3.2.57 - /bin/bash
二进制文件:
节点:11.7.0 - /usr/local/bin/node
纱线:1.13.0 - /usr/local/bin/yarn
npm: 6.5.0 - /usr/local/bin/npm
语言:
Python:2.7.10 - /usr/bin/python
浏览器:
铬:71.0.3578.98
Safari:12.0.2
npm 软件包:
盖茨比:^2.0.76 => 2.0.76
盖茨比图像:^2.0.20 => 2.0.25
盖茨比插件清单:^2.0.9 => 2.0.12
盖茨比插件离线:^2.0.16 => 2.0.20
盖茨比插件反应头盔:^3.0.2 => 3.0.5
gatsby-plugin-sharp: ^2.0.14 => 2.0.16
gatsby 源文件系统:^2.0.8 => 2.0.12
盖茨比变压器夏普:^2.1.8 => 2.1.9

### File contents (if changed)

`gatsby-config.js`:<!-- Please use a code block or just leave it as is if wasn't changed -->

模块.出口 = {
站点元数据:{
标题: Gatsby Starter ,
描述: Kick off your next, great Gatsby project with this default starter. This barebones starter ships with the main Gatsby configuration files you might need. ,
作者: @gatsbyjs ,
社交链接:[
{
名称: Link 1 ,
网址: https://twitter.com/ ,
},
{
名称: link 2 ,
网址: https://github.com/ ,
}
],
特征: [
{
标题: Feature 1 ,
描述: Kick off your next, great Gatsby project with this default starter. This barebones starter ships with the main Gatsby configuration files you might need. ,
},
{
标题: Feature 2 ,
描述: Kick off your next, great Gatsby project with this default starter. This barebones starter ships with the main Gatsby configuration files you might need. ,
},
{
标题: Feature 3 ,
描述: Kick off your next, great Gatsby project with this default starter. This barebones starter ships with the main Gatsby configuration files you might need. ,
},
],
},
插件: [
gatsby-plugin-react-helmet ,
{
解决: gatsby-source-filesystem ,
选项: {
名称: images ,
路径: ${__dirname}/src/images ,
},
},
gatsby-transformer-sharp ,
gatsby-plugin-sharp ,
{
解决: gatsby-plugin-manifest
选项: {
名称: gatsby-starter-default ,
short_name: starter ,
start_url: / ,
背景颜色: #663399
主题颜色: #663399
显示: minimal-ui
icon: src/images/gatsby-icon.png , // 这个路径是相对于站点根目录的。
},
},
// 此(可选)插件启用渐进式 Web 应用 + 离线功能
// 要了解更多信息,请访问: https :
// 'gatsby-plugin-offline',
],
}

`package.json`:<!-- Please use a code block or just leave it as is if wasn't changed -->

{
"name": "gatsby-starter-default",
“私人”:真的,
"description": "一个简单的入门,快速上手和 Gatsby 一起开发",
"版本": "0.1.0",
"author": "凯尔·马修斯[email protected] ",
“依赖关系”:{
"盖茨比": "^2.0.76",
"gatsby-image": "^2.0.20",
"gatsby-plugin-manifest": "^2.0.9",
"gatsby-plugin-offline": "^2.0.16",
"gatsby-plugin-react-helmet": "^3.0.2",
"gatsby-plugin-sharp": "^2.0.14",
"gatsby-source-filesystem": "^2.0.8",
"gatsby-transformer-sharp": "^2.1.8",
"道具类型": "^15.6.2",
“反应”:“^ 16.6.3”,
"react-dom": "^16.6.3",
“反应头盔”:“^ 5.2.0”
},
“关键词”:[
《盖茨比》
],
"许可证": "麻省理工学院",
“脚本”:{
"build": "盖茨比构建",
"develop": "盖茨比开发",
"start": "npm 运行开发",
"format": "prettier --write \"src/ */ .js\"",
"test": "echo \"写测试! -> https://gatsby.app/unit-testing\ ""
},
“开发依赖”:{
“更漂亮”:“^1.15.2”
},
“存储库”:{
"类型": "git",
“网址”:“ https://github.com/gatsbyjs/gatsby-starter-default
},
“错误”:{
“网址”:“ https://github.com/gatsbyjs/gatsby/issues
}
}
`` gatsby-node.js : N/A <!-- Please use a code block or just leave it as is if wasn't changed --> gatsby-browser.js : N/A <!-- Please use a code block or just leave it as is if wasn't changed --> gatsby-ssr.js`:不适用

最有用的评论

~ @AlexanderProd

没关系,就我而言,我正在使用

bodyAttributes={{
  style: 'some style string'
}}

在自动生成的SEO.js<Helmet />实例中。 使用样式对象不起作用,我认为这是 react-helmet 的问题。 将我的风格转换为一个类并使用它来解决我的问题。

对于 Google 到达的其他人,错误是style调用不正确(即,不要使用字符串,使用对象)。

>所有评论

~ @AlexanderProd

没关系,就我而言,我正在使用

bodyAttributes={{
  style: 'some style string'
}}

在自动生成的SEO.js<Helmet />实例中。 使用样式对象不起作用,我认为这是 react-helmet 的问题。 将我的风格转换为一个类并使用它来解决我的问题。

对于 Google 到达的其他人,错误是style调用不正确(即,不要使用字符串,使用对象)。

此页面是否有帮助?
0 / 5 - 0 等级

相关问题

totsteps picture totsteps  ·  3评论

dustinhorton picture dustinhorton  ·  3评论

magicly picture magicly  ·  3评论

dustinhorton picture dustinhorton  ·  3评论

rossPatton picture rossPatton  ·  3评论