Gatsby SSR error. Failed Building static HTML for pages
See original GitHub issueš Bug Report
During gatsby build get an error:
failed Building static HTML for pages
4 | export default function About() {
5 | const path = 'CustomLoaded';
> 6 | const ModuleComponent = loadable(() => import(`../component/${path}`));
| ^
7 |
8 | return (
9 | <div>
WebpackError: TypeError: Cannot read property 'call' of undefined
- about.js:6
src/pages/about.js:6:35
- loadable.esm.js:205
node_modules/@loadable/component/dist/loadable.esm.js:205:1
- loadable.esm.js:141
node_modules/@loadable/component/dist/loadable.esm.js:141:1
To Reproduce
gatsby build
Expected behavior
Build without errors.
Link to repl or repo (highly encouraged)
Please, find minimal working example here: https://github.com/MaxBoltik/loadable-components-bug
Run npx envinfo --system --binaries --npmPackages @loadable/component,@loadable/server,@loadable/webpack-plugin,@loadable/babel-plugin --markdown --clipboard
## System:
- OS: Linux 5.4 Ubuntu 18.04.4 LTS (Bionic Beaver)
- CPU: (4) x64 Intel(R) Core(TM) i7-4510U CPU @ 2.00GHz
- Memory: 317.04 MB / 7.66 GB
- Container: Yes
- Shell: 4.4.20 - /bin/bash
## Binaries:
- Node: 14.0.0 - ~/.nvm/versions/node/v14.0.0/bin/node
- npm: 6.14.4 - ~/.nvm/versions/node/v14.0.0/bin/npm
- Watchman: 20200802.200524.0 - /usr/local/bin/watchman
## npmPackages:
- @loadable/babel-plugin: ^5.13.0 => 5.13.0
- @loadable/component: ^5.13.1 => 5.13.1
- @loadable/server: ^5.13.1 => 5.13.1
- @loadable/webpack-plugin: ^5.13.0 => 5.13.0
Issue Analytics
- State:
- Created 3 years ago
- Reactions:13
- Comments:9
Top Results From Across the Web
failed Building static HTML for pages, Building static HTML ...
I am getting this error when i am trying to build my gatsby site. "gatsby build". Note that it works fine on "gatsby...
Read more >failed Building static HTML for pages - Gatsby and p5js
Getting this error when deploying to github pages: failed Building static HTML for pages. I am using "react-p5": "^1.3.6".
Read more >Debugging HTML Builds | Gatsby
Errors while building static HTML files (the build-time React SSR process) or ... Gatsby treats any JS file listed under the pages dir...
Read more >Debugging HTML Builds | GatsbyJS äøęē½
Errors while building static HTML files generally happen for one of the following reasons: Some of your code references "browser globalsā¦
Read more >[Gatsby] Building static HTML failed for path - Support
There is an error when trying to build the website, the weird thing is that this is only happening in netlify, when I...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
So there are good news and bad news:
Good news
loadable
in a little bit āwrongā way, and itās more or less expected to failBad news
Look like āfull dynamic importā is just working as expected with Gatsby, and chunks referred using it just not included. Iāve checked module cache, and
components
are not there.That the ārun timeā problem in #618 is your problem.
I donāt have a solution unless I have a problem. The minimal use case youāve provided should be enough to find the root cause and fix it. But it would be not today.