Hello, I have the error when I run the build, error has failed for the path, I have no idea where this error occurs.
error Building static HTML failed for path "/home/"
See our docs page on debugging HTML builds for help https://gatsby.dev/debug-html
7 |
8 | if (isProduction) {
> 9 | throw new Error(prefix);
| ^
10 | } else {
11 | throw new Error(prefix + ": " + (message || ''));
12 | }
WebpackError: Invariant failed
- tiny-invariant.esm.js:9 invariant
[lib]/[tiny-invariant]/dist/tiny-invariant.esm.js:9:1
- history.js:250 createBrowserHistory
[lib]/[history]/esm/history.js:250:115
- react-router-dom.js:29 new BrowserRouter
[lib]/[react-router-dom]/esm/react-router-dom.js:29:41
- bootstrap:22 c
lib/webpack/bootstrap:22:1
- bootstrap:25 Sa
lib/webpack/bootstrap:25:1
- bootstrap:30 a.render
lib/webpack/bootstrap:30:1
- bootstrap:30 a.read
lib/webpack/bootstrap:30:1
- bootstrap:42 renderToString
lib/webpack/bootstrap:42:1
- static-entry.js:194 Module../.cache/static-entry.js.__webpack_exports__.default
lib/.cache/static-entry.js:194:18
- bootstrap:24 Promise
lib/webpack/bootstrap:24:1
- gatsby-browser-entry.js:19 Promise._resolveFromExecutor
lib/.cache/gatsby-browser-entry.js:19:9
- bootstrap:68 new Promise
lib/webpack/bootstrap:68:1
- bootstrap:5 tryCatcher
lib/webpack/bootstrap:5:1
- bootstrap:50 MappingPromiseArray._promiseFulfilled
lib/webpack/bootstrap:50:1`
Solved it
I get a similar error for the path "/404/", which I have not modified. This happened after running npm update and only in npm run build.
error Building static HTML failed for path "/404/" See our docs page on debugging HTML builds for help https://gatsby.dev/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.object.to-string"], 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["crypto"], 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_object_to_string__, __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_crypto__, __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 #130; visit https://reactjs.org/ docs/error-decoder.html?invariant=130&args[]=object&args[]= for the full message or use the non-minified dev environment for full errors and additional helpful warnings. - universalModuleDefinition:10 ba lib/webpack/universalModuleDefinition:10:2 - bootstrap:33 a.render lib/webpack/bootstrap:33:1 - bootstrap:30 a.read lib/webpack/bootstrap:30:1 - bootstrap:42 renderToString lib/webpack/bootstrap:42:1 - static-entry.js:206 Module.default lib/.cache/static-entry.js:206:18 - bootstrap:24 Promise lib/webpack/bootstrap:24:1 - gatsby-browser-entry.js:44 Promise._resolveFromExecutor lib/.cache/gatsby-browser-entry.js:44:19 - bootstrap:68 new Promise lib/webpack/bootstrap:68:1 - bootstrap:5 tryCatcher lib/webpack/bootstrap:5:1 - bootstrap:50 MappingPromiseArray._promiseFulfilled lib/webpack/bootstrap:50:1 - api-runner-ssr.js:6 MappingPromiseArray.PromiseArray._iterate lib/.cache/api-runner-ssr.js:6:16 - bootstrap:67 MappingPromiseArray.init lib/webpack/bootstrap:67:1 - bootstrap:19 MappingPromiseArray._asyncInit lib/webpack/bootstrap:19:1
Below is the package.json of the last successful build
{
"name": "gatsby-starter-default",
"description": "Gatsby default starter",
"version": "1.0.0",
"author": "Kyle Mathews mathews.kyle@gmail.com",
"dependencies": {
"gatsby": "^2.1.17",
"gatsby-image": "^2.0.29",
"gatsby-plugin-manifest": "^2.0.19",
"gatsby-plugin-offline": "^2.0.24",
"gatsby-plugin-react-helmet": "^3.0.6",
"gatsby-plugin-sharp": "^2.0.22",
"gatsby-source-filesystem": "^2.0.22",
"gatsby-transformer-sharp": "^2.1.14",
"react": "^16.8.3",
"react-dom": "^16.8.3",
"react-helmet": "^5.2.0",
"sharp": "^0.21.3"
},
"keywords": [
"gatsby"
],
"license": "MIT",
"scripts": {
"build": "gatsby build",
"develop": "gatsby develop",
"start": "npm run develop",
"format": "prettier --write \"src/*/.js\"",
"test": "echo \"Error: no test specified\" && exit 1",
"deploy": "gatsby build --prefix-paths && gh-pages -d public"
},
"devDependencies": {
"gh-pages": "^2.0.1",
"prettier": "^1.16.4"
},
"repository": {
"type": "git",
"url": "https://github.com/gatsbyjs/gatsby-starter-default"
}
}
I found a solution to my problem and it was about my react component. Sorry about the additional post. I solved it by brute force, checked my github, and one by one disabled added components from the last successful built and found the culprit. Good luck !
@antonioc57 This typically occurs when there is an error during server side rendering in gatsby build
Based on your stack trace, it looks like it is coming from react-router-dom
. Gatsby v2 includes reach router for routing so you shouldn't need to include react-router-dom.
@antonioc57 ,
I had the same problem. It was connected to history package. I see you are using it as well.
!canUseDOM ? process.env.NODE_ENV !== "production" ? invariant(false, 'Browser history needs a DOM') : invariant(false) : void 0;
This code from history.js shows that it needs DOM which is unavailable during production build process.
The workaround I did is:
const history = typeof window !== 'undefined' ? createBrowserHistory() : null;
You can do the same trick with other functionalities of that library you might be using.
Hope this helps.
Hiya!
This issue has gone quiet. Spooky quiet. 馃懟
We get a lot of issues, so we currently close issues after 30 days of inactivity. It鈥檚 been at least 20 days since the last update here.
If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!
Thanks for being a part of the Gatsby community! 馃挭馃挏
Hey again!
It鈥檚 been 30 days since anything happened on this issue, so our friendly neighborhood robot (that鈥檚 me!) is going to close it.
Please keep in mind that I鈥檓 only a robot, so if I鈥檝e closed this issue in error, I鈥檓 HUMAN_EMOTION_SORRY
. Please feel free to reopen this issue or create a new one if you need anything else.
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!
Thanks again for being part of the Gatsby community!
Got same error:
Building static HTML failed for path "/404/"
See our docs page for more info on this error: https://gatsby.dev/debug-html
Error: Minified React error #294; visit https://reactjs.org/docs/error-decoder.html?invariant=294 for the full message or use the non-minified dev environment f or full errors and additional helpful warnings.
- react-dom-server.node.production.min.js:46 a.b.render
[myproject]/[react-dom]/cjs/react-dom-server.node.production.min.js:46:17
- react-dom-server.node.production.min.js:44 a.b.read
[myproject]/[react-dom]/cjs/react-dom-server.node.production.min.js:44:18
- react-dom-server.node.production.min.js:54 renderToString
[myproject]/[react-dom]/cjs/react-dom-server.node.production.min.js:54:364
- render-page.js:612 Module../.cache/static-entry.js.__webpack_exports__.default
E:/myproject/public/render-page.js:612:28
- render-html.js:28
[myproject]/[gatsby]/dist/utils/worker/render-html.js:28:36
- debuggability.js:384 Promise._execute
[myproject]/[bluebird]/js/release/debuggability.js:384:9
- promise.js:518 Promise._resolveFromExecutor
[myproject]/[bluebird]/js/release/promise.js:518:18
- promise.js:103 new Promise
[myproject]/[bluebird]/js/release/promise.js:103:10
- render-html.js:24
[myproject]/[gatsby]/dist/utils/worker/render-html.js:24:47
- util.js:16 tryCatcher
[myproject]/[bluebird]/js/release/util.js:16:23
- map.js:68 MappingPromiseArray._promiseFulfilled
[myproject]/[bluebird]/js/release/map.js:68:38
- promise_array.js:115 MappingPromiseArray.PromiseArray._iterate
[myproject]/[bluebird]/js/release/promise_array.js:115:31
- promise_array.js:79 MappingPromiseArray.init
[myproject]/[bluebird]/js/release/promise_array.js:79:10
- map.js:37 MappingPromiseArray._asyncInit
[myproject]/[bluebird]/js/release/map.js:37:10
- async.js:97 _drainQueueStep
[myproject]/[bluebird]/js/release/async.js:97:12
- async.js:86 _drainQueue
[myproject]/[bluebird]/js/release/async.js:86:9
not finished Generating image thumbnails - 228.649s
dependencies I am using:
"dependencies": {
"axios": "^0.19.2",
"browser-lang": "^0.0.1",
"checkout-js-library": "^1.1.7",
"core-js": "^3.6.4",
"currency.js": "^1.2.2",
"gatsby": "^2.19.19",
"gatsby-cli": "^2.10.6",
"gatsby-image": "^2.2.39",
"gatsby-link": "^2.2.28",
"gatsby-paginate": "^1.1.1",
"gatsby-plugin-algolia": "^0.5.0",
"gatsby-plugin-alias-imports": "^1.0.5",
"gatsby-plugin-analytics": "^0.2.0",
"gatsby-plugin-catch-links": "^2.0.2",
"gatsby-plugin-dark-mode": "^1.1.0",
"gatsby-plugin-facebook-analytics": "^2.2.20",
"gatsby-plugin-facebook-pixel": "^1.0.3",
"gatsby-plugin-feed": "^2.0.5",
"gatsby-plugin-firebase": "^0.1.8",
"gatsby-plugin-google-analytics": "^2.1.34",
"gatsby-plugin-google-fonts": "^1.0.1",
"gatsby-plugin-guess-js": "^1.1.31",
"gatsby-plugin-i18n": "^1.0.1",
"gatsby-plugin-intercom-spa": "^0.2.0",
"gatsby-plugin-intl": "^0.3.3",
"gatsby-plugin-layout": "^1.0.2",
"gatsby-plugin-lint-queries": "^0.0.3",
"gatsby-plugin-mailchimp": "^5.1.2",
"gatsby-plugin-manifest": "^2.2.40",
"gatsby-plugin-netlify": "^2.0.0",
"gatsby-plugin-nprogress": "^2.1.18",
"gatsby-plugin-offline": "^3.0.33",
"gatsby-plugin-prefetch-google-fonts": "^1.4.3",
"gatsby-plugin-provide-react": "^1.0.0",
"gatsby-plugin-react-helmet": "^3.1.21",
"gatsby-plugin-react-redux": "^1.1.0-0",
"gatsby-plugin-react-svg": "^3.0.0",
"gatsby-plugin-remove-trailing-slashes": "^2.1.22",
"gatsby-plugin-robots-txt": "^1.5.0",
"gatsby-plugin-sentry": "^1.0.1",
"gatsby-plugin-sharp": "^2.4.4",
"gatsby-plugin-sitemap": "^2.2.26",
"gatsby-plugin-styled-components": "^3.1.18",
"gatsby-plugin-styled-jsx": "^3.0.1",
"gatsby-plugin-web-font-loader": "^1.0.4",
"gatsby-remark-copy-linked-files": "^2.0.5",
"gatsby-remark-emojis": "^0.2.3",
"gatsby-remark-external-links": "^0.0.4",
"gatsby-remark-images": "^3.1.43",
"gatsby-remark-prismjs": "^3.3.30",
"gatsby-source-filesystem": "^2.1.47",
"gatsby-source-googlemaps-geocoding": "^1.0.0",
"gatsby-source-instagram": "^0.7.0",
"gatsby-source-magento": "file:plugins/gatsby-source-magento",
"gatsby-source-wordpress": "file:plugins/gatsby-source-wordpress",
"gatsby-transformer-json": "^2.2.25",
"gatsby-transformer-remark": "^2.6.49",
"gatsby-transformer-sharp": "^2.3.13",
"moment": "^2.24.0",
"postscribe": "^2.0.8",
"prismjs": "^1.15.0",
"prop-types": "^15.7.2",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"react-helmet": "^5.2.1",
"react-icons": "^3.9.0",
"react-intl": "^2.8.0",
"react-redux": "^7.1.3",
"recompose": "^0.30.0",
"redux": "^4.0.5",
"redux-thunk": "^2.3.0",
},
Got same error:
Building static HTML failed for path "/404/" See our docs page for more info on this error: https://gatsby.dev/debug-html Error: Minified React error #294; visit https://reactjs.org/docs/error-decoder.html?invariant=294 for the full message or use the non-minified dev environment f or full errors and additional helpful warnings. - react-dom-server.node.production.min.js:46 a.b.render [myproject]/[react-dom]/cjs/react-dom-server.node.production.min.js:46:17 - react-dom-server.node.production.min.js:44 a.b.read [myproject]/[react-dom]/cjs/react-dom-server.node.production.min.js:44:18 - react-dom-server.node.production.min.js:54 renderToString [myproject]/[react-dom]/cjs/react-dom-server.node.production.min.js:54:364 - render-page.js:612 Module../.cache/static-entry.js.__webpack_exports__.default E:/myproject/public/render-page.js:612:28 - render-html.js:28 [myproject]/[gatsby]/dist/utils/worker/render-html.js:28:36 - debuggability.js:384 Promise._execute [myproject]/[bluebird]/js/release/debuggability.js:384:9 - promise.js:518 Promise._resolveFromExecutor [myproject]/[bluebird]/js/release/promise.js:518:18 - promise.js:103 new Promise [myproject]/[bluebird]/js/release/promise.js:103:10 - render-html.js:24 [myproject]/[gatsby]/dist/utils/worker/render-html.js:24:47 - util.js:16 tryCatcher [myproject]/[bluebird]/js/release/util.js:16:23 - map.js:68 MappingPromiseArray._promiseFulfilled [myproject]/[bluebird]/js/release/map.js:68:38 - promise_array.js:115 MappingPromiseArray.PromiseArray._iterate [myproject]/[bluebird]/js/release/promise_array.js:115:31 - promise_array.js:79 MappingPromiseArray.init [myproject]/[bluebird]/js/release/promise_array.js:79:10 - map.js:37 MappingPromiseArray._asyncInit [myproject]/[bluebird]/js/release/map.js:37:10 - async.js:97 _drainQueueStep [myproject]/[bluebird]/js/release/async.js:97:12 - async.js:86 _drainQueue [myproject]/[bluebird]/js/release/async.js:86:9 not finished Generating image thumbnails - 228.649s
dependencies I am using:
"dependencies": { "axios": "^0.19.2", "browser-lang": "^0.0.1", "checkout-js-library": "^1.1.7", "core-js": "^3.6.4", "currency.js": "^1.2.2", "gatsby": "^2.19.19", "gatsby-cli": "^2.10.6", "gatsby-image": "^2.2.39", "gatsby-link": "^2.2.28", "gatsby-paginate": "^1.1.1", "gatsby-plugin-algolia": "^0.5.0", "gatsby-plugin-alias-imports": "^1.0.5", "gatsby-plugin-analytics": "^0.2.0", "gatsby-plugin-catch-links": "^2.0.2", "gatsby-plugin-dark-mode": "^1.1.0", "gatsby-plugin-facebook-analytics": "^2.2.20", "gatsby-plugin-facebook-pixel": "^1.0.3", "gatsby-plugin-feed": "^2.0.5", "gatsby-plugin-firebase": "^0.1.8", "gatsby-plugin-google-analytics": "^2.1.34", "gatsby-plugin-google-fonts": "^1.0.1", "gatsby-plugin-guess-js": "^1.1.31", "gatsby-plugin-i18n": "^1.0.1", "gatsby-plugin-intercom-spa": "^0.2.0", "gatsby-plugin-intl": "^0.3.3", "gatsby-plugin-layout": "^1.0.2", "gatsby-plugin-lint-queries": "^0.0.3", "gatsby-plugin-mailchimp": "^5.1.2", "gatsby-plugin-manifest": "^2.2.40", "gatsby-plugin-netlify": "^2.0.0", "gatsby-plugin-nprogress": "^2.1.18", "gatsby-plugin-offline": "^3.0.33", "gatsby-plugin-prefetch-google-fonts": "^1.4.3", "gatsby-plugin-provide-react": "^1.0.0", "gatsby-plugin-react-helmet": "^3.1.21", "gatsby-plugin-react-redux": "^1.1.0-0", "gatsby-plugin-react-svg": "^3.0.0", "gatsby-plugin-remove-trailing-slashes": "^2.1.22", "gatsby-plugin-robots-txt": "^1.5.0", "gatsby-plugin-sentry": "^1.0.1", "gatsby-plugin-sharp": "^2.4.4", "gatsby-plugin-sitemap": "^2.2.26", "gatsby-plugin-styled-components": "^3.1.18", "gatsby-plugin-styled-jsx": "^3.0.1", "gatsby-plugin-web-font-loader": "^1.0.4", "gatsby-remark-copy-linked-files": "^2.0.5", "gatsby-remark-emojis": "^0.2.3", "gatsby-remark-external-links": "^0.0.4", "gatsby-remark-images": "^3.1.43", "gatsby-remark-prismjs": "^3.3.30", "gatsby-source-filesystem": "^2.1.47", "gatsby-source-googlemaps-geocoding": "^1.0.0", "gatsby-source-instagram": "^0.7.0", "gatsby-source-magento": "file:plugins/gatsby-source-magento", "gatsby-source-wordpress": "file:plugins/gatsby-source-wordpress", "gatsby-transformer-json": "^2.2.25", "gatsby-transformer-remark": "^2.6.49", "gatsby-transformer-sharp": "^2.3.13", "moment": "^2.24.0", "postscribe": "^2.0.8", "prismjs": "^1.15.0", "prop-types": "^15.7.2", "react": "^16.12.0", "react-dom": "^16.12.0", "react-helmet": "^5.2.1", "react-icons": "^3.9.0", "react-intl": "^2.8.0", "react-redux": "^7.1.3", "recompose": "^0.30.0", "redux": "^4.0.5", "redux-thunk": "^2.3.0", },
Hey folks,
I was getting the same issue then I removed the code of Suspense and Lazy load from my file. It worked!
I hope it may work for you as well until they add the support for these.
Happy Coding!
i dont get, what code of suspense and lazy??
i dont get, what code of suspense and lazy??
I got the same errror when I ran "gatsby build" , but it was working fine in development.
in my gatsby project i was handling global state using contextApi & Reducer so i had to make changes to gatsby-ssr & gatsby-browser to import provider and wrap it to root element.
I had exported Provideras default in contextfile.
the problem was I was importing provider as below in browser-ssr.js
const GlobalProvider = require("./src/context/GlobalState")
I just changed it and added .default in the end like below & it started working fine.
const GlobalProvider = require("./src/context/GlobalState").default;
now I am adding my error detailso you can relate to it.
failed Building static HTML for pages - 4.252s
5:07:47 PM: error Building static HTML failed for path "/blog"
5:07:48 PM:
5:07:48 PM:
5:07:48 PM: Error: Minified React error #130; visit https://reactjs.org/docs/error-decoder .html?invariant=130&args[]=object&args[]= for the full message or use the non- minified dev environment for full errors and additional helpful warnings.
5:07:48 PM:
5:07:48 PM: - react-dom-server.node.production.min.js:48 a.b.render
5:07:48 PM: [repo]/[react-dom]/cjs/react-dom-server.node.production.min.js:48:37
5:07:48 PM:
5:07:48 PM: - react-dom-server.node.production.min.js:44 a.b.read
5:07:48 PM: [repo]/[react-dom]/cjs/react-dom-server.node.production.min.js:44:18
5:07:48 PM:
5:07:48 PM: - react-dom-server.node.production.min.js:54 renderToString
5:07:48 PM: [repo]/[react-dom]/cjs/react-dom-server.node.production.min.js:54:364
5:07:48 PM:
5:07:48 PM: - render-page.js:654 Module../.cache/static-entry.js.__webpack_exports__.defau lt
5:07:48 PM: /opt/build/repo/public/render-page.js:654:28
5:07:48 PM:
5:07:48 PM: - render-html.js:28
5:07:48 PM: [repo]/[gatsby]/dist/utils/worker/render-html.js:28:36
5:07:48 PM:
5:07:48 PM: - debuggability.js:384 Promise._execute
5:07:48 PM: [repo]/[bluebird]/js/release/debuggability.js:384:9
5:07:48 PM:
5:07:48 PM: - promise.js:518 Promise._resolveFromExecutor
5:07:48 PM: [repo]/[bluebird]/js/release/promise.js:518:18
5:07:48 PM:
5:07:48 PM: - promise.js:103 new Promise
5:07:48 PM: [repo]/[bluebird]/js/release/promise.js:103:10
5:07:48 PM:
5:07:48 PM: - render-html.js:24
5:07:48 PM: [repo]/[gatsby]/dist/utils/worker/render-html.js:24:47
5:07:48 PM:
5:07:48 PM: - util.js:16 tryCatcher
5:07:48 PM: [repo]/[bluebird]/js/release/util.js:16:23
5:07:48 PM:
5:07:48 PM: - map.js:68 MappingPromiseArray._promiseFulfilled
5:07:48 PM: [repo]/[bluebird]/js/release/map.js:68:38
5:07:48 PM:
5:07:48 PM: - promise_array.js:115 MappingPromiseArray.PromiseArray._iterate
5:07:48 PM: [repo]/[bluebird]/js/release/promise_array.js:115:31
5:07:48 PM:
5:07:48 PM: - promise_array.js:79 MappingPromiseArray.init
5:07:48 PM: [repo]/[bluebird]/js/release/promise_array.js:79:10
5:07:48 PM:
5:07:48 PM: - map.js:37 MappingPromiseArray._asyncInit
5:07:48 PM: [repo]/[bluebird]/js/release/map.js:37:10
5:07:48 PM:
5:07:48 PM: - async.js:97 _drainQueueStep
5:07:48 PM: [repo]/[bluebird]/js/release/async.js:97:12
5:07:48 PM:
5:07:48 PM: - async.js:86 _drainQueue
5:07:48 PM: [repo]/[bluebird]/js/release/async.js:86:9
Most helpful comment
Got same error:
dependencies I am using: