-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build fails when error thrown inside Suspense boundary #37613
Comments
Hi. I was wondering if you might have a spot on your team to help resolve the issue at hand. |
You are right. Our current implementation crashes the build on any error anywhere (which includes tree under In particular gatsby/packages/gatsby/cache-dir/static-entry.js Lines 340 to 347 in bc6c3ef
fails the build in Per React docs ( https://beta.reactjs.org/reference/react-dom/server/renderToPipeableStream ) we should fail the build only in |
I started work on fixing this to match React guideline in #37648 |
Some news here. I've was able to adjust html gen to not fail in my PR, but what I'm seeing right now is the setup with suspended components throwing in production builds result in this error https://reactjs.org/docs/error-decoder.html/?invariant=419 in the browser being logged and development showing error overlay: I did check wether Next.js have similar behavior and it actually does as well: So ... it doesn't seem like this way of skipping components in SSR actually does work? Are you aware of any framework or other reference where this setup actually work in practice? |
This was the first time I had tried implementing it, but I can replicate the behaviour you're seeing in Next.js as well. I also tried with Remix, which doesn't trigger an overlay but still throws an error in the browser console. The original React documentation for the pattern doesn't mention this, so it's unclear to me whether it's expected or not |
Does this have some relation with the problem mentioned in #36678, specifically here?
|
You'd need to also implement Here's how Next.js does this for its own "noSSR" feature: So Gatsby could expose something similar. |
@gaearon You've said that Next.js implemented what you mentioned but as shown in #37613 (comment) it also doesn't work there? |
I think Dan was referring to the |
Preliminary Checks
Description
I am trying to use the following pattern from the React docs to opt out of server rendering for a particular component
However, Gatsby does not appear to support this and instead fails whilst attempting to build static HTML for the page in question
Reproduction Link
https://codesandbox.io/p/sandbox/gatsby-ssr-c2foq1
Steps to Reproduce
Run
gatsby build
Expected Result
The build should complete successfully
Actual Result
The build fails
Environment
Config Flags
No response
The text was updated successfully, but these errors were encountered: