Closed junghyeonsu closed 1 year ago
Hi @junghyeonsu
I was able to get same error as reported with your reproduction and will be looking into it.
For now I can only explain why it happens on refresh - DEV_SSR
does have a timeout in which it no longer wait on page to be fully SSRed after ~2s to not keep developer wait too long to be able to interact at least with client and we serve "shell" then, but continue going through SSR pipeline in background so it's ready when page is eventually refreshed. And when everything is actually ready we get error you reported
I opened https://github.com/gatsbyjs/gatsby/pull/37542 with the fix (well, adding missing support for slices with DEV_SSR). I did verify that those changes do fix the problem on your repro.
Will be looking to get fix approved, merged and released after the weekend
Thank you very much for your quick response!! 👍 After merged, I will test it again!
Fix published in @next
dist tag for testing - gatsby@5.6.0-next.2
awesome! It works well with DEV_SSR
flag!
Thank you 👍
Preliminary Checks
Description
hello.
I am trying to use the new slice api from the gatsby 5 version, but I get an SSR related error only in the development environment. (It works fine when building and serving.)
I tested the Slice component as a component that just renders text without anything special.
Error Message
Test Slice Component
Usage
I located test slice in
docs/src/pages/component/index.tsx
.gatsby-node
I used the api by referring to the documentation without anything special.
package.json
I use gatsby
5.5.0
versionReproduction Link
https://github.com/daangn/seed-design/tree/chore/slice-api
Steps to Reproduce
yarn install
at project rootyarn build
to build packagescd docs
to move gatsby project folderyarn dev
to start dev serverhttp://localhost:8000/component/
Expected Result
Reload page with no error and we should be able to see the
test
Text.Actual Result
Error occurs when reloading.
Environment
Config Flags
only
DEV_SSR: true