During build on building static HTML get error:
8 | else
9 | root["lib"] = factory(root["@reach/router"], root["core-
js/modules/es6.array.sort"], 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_sort__,
__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 #152; visit
https://reactjs.org/docs/error-decoder.html?
invariant=152&args[]=Component for the f ull message or use the non-
minified dev environment for full errors and additional helpful
warnings.
Although the message is kind of cryptic. (doesn't say in which component it fails), it seems the problem should reside in react-helmet at first.
Tried to update versions of react-helmet and react-plugin-helmet. Didn't work. Erased all the traces of react-helmet and the error was gone, but appeared a similar error with lodash ( Invariant Violation: Minified React error #152) right after that. Lodash is only referenced in package-lock.json. Tried install in package.json lodash and gatsby-plugin lodash with no success.
In develop mode, as expected, everything works.
I checked every component return before. I went even further, abandoned implicit return and made all returns in React explicit.
Still no work
build problems don't disappear with downgrading node or updating gatsby and react to latest versions.
Here's the repo
https://github.com/pedrotavaresgoncalves/gatsby-debug
Environment:
System:
OS: macOS 10.14
CPU: x64 Intel(R) Core(TM) i7-3615QM CPU @ 2.30GHz
Shell: 3.2.57 - /bin/bash
Binaries:
Node: v10.13.0 - /usr/local/bin/node
npm: 6.4.1 - /usr/local/bin/npm
Browsers:
Chrome: 70.0.3538.77
Firefox: 60.0.2
Safari: 12.0
npmPackages:
gatsby: 2.0.19 => 2.0.19
gatsby-image: ^2.0.19 => 2.0.19
gatsby-plugin-lodash: ^3.0.2 => 3.0.2
gatsby-plugin-manifest: 2.0.2 => 2.0.2
gatsby-plugin-offline: 2.0.5 => 2.0.5
gatsby-plugin-react-helmet: ^3.0.1 => 3.0.1
gatsby-plugin-sass: 2.0.1 => 2.0.1
gatsby-plugin-sharp: 2.0.6 => 2.0.6
gatsby-plugin-typography: ^2.2.0 => 2.2.0
gatsby-source-filesystem: 2.0.1 => 2.0.1
gatsby-transformer-json: 2.1.2 => 2.1.2
gatsby-transformer-remark: 2.1.3 => 2.1.3
gatsby-transformer-sharp: 2.1.3 => 2.1.3
npmGlobalPackages:
gatsby-cli: 2.4.4