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
feat(gatsby): Slices API #36489
feat(gatsby): Slices API #36489
Conversation
This reverts commit 1b2d632.
message = `Slice "${sliceName}" was passed props ${componentHint}that are not serializable (${errors}).` | ||
} else { | ||
// we can't really grab any extra info outside of the browser, so just print what we can | ||
message = `${name}: Slice "${sliceName}" was passed props that are not serializable (${errors}). Use \`gatsby develop\` to see more information.` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where/How in gatsby develop
would they see more info? Terminal? Browser console? Error overlay?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something must have changed recently or we added a level of depth in our tree.
It used to render to the first line of the file containing the error-ing Slice. Should be somewhere in here:
gatsby/packages/gatsby/cache-dir/slice.js
Line 61 in 1b94c72
// remove the first line of the stack trace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This proves to be difficult to resolve in confident way. The component stack I'm getting is missing file/line number location for a lot of frames (including the component that uses the slice):
at Slice (webpack-internal:///./.cache/slice.js:32:24)
at main
at IndexPage
at PageRenderer (webpack-internal:///./.cache/page-renderer.js:21:84)
at PageQueryStore (webpack-internal:///./.cache/query-result-store.js:40:30)
at RouteHandler
at div
at oe (webpack-internal:///./node_modules/@gatsbyjs/reach-router/dist/index.modern.mjs:38:9978)
at re (webpack-internal:///./node_modules/@gatsbyjs/reach-router/dist/index.modern.mjs:38:9765)
at ie (webpack-internal:///./node_modules/@gatsbyjs/reach-router/dist/index.modern.mjs:38:11249)
at se (webpack-internal:///./node_modules/@gatsbyjs/reach-router/dist/index.modern.mjs:38:11123)
at ScrollHandler (webpack-internal:///./node_modules/gatsby-react-router-scroll/scroll-handler.js:36:35)
at RouteUpdates (webpack-internal:///./.cache/navigation.js:289:32)
at EnsureResources (webpack-internal:///./.cache/ensure-resources.js:22:30)
at LocationHandler (webpack-internal:///./.cache/root.js:64:29)
at eval (webpack-internal:///./node_modules/@gatsbyjs/reach-router/dist/index.modern.mjs:38:8351)
at H (webpack-internal:///./node_modules/@gatsbyjs/reach-router/dist/index.modern.mjs:38:7249)
at G (webpack-internal:///./node_modules/@gatsbyjs/reach-router/dist/index.modern.mjs:38:7551)
at WithErrorBoundary()
at Q (webpack-internal:///./node_modules/@gatsbyjs/reach-router/dist/index.modern.mjs:38:9142)
at Root
at StaticQueryStore (webpack-internal:///./.cache/query-result-store.js:159:32)
at SliceDataStore (webpack-internal:///./.cache/query-result-store.js:215:32)
at ErrorBoundary (webpack-internal:///./.cache/fast-refresh-overlay/components/error-boundary.js:24:35)
at DevOverlay (webpack-internal:///./.cache/fast-refresh-overlay/index.js:124:5)
at RootWrappedWithOverlayAndProvider
at App (webpack-internal:///./.cache/app.js:184:80)
During debugging I found information about code location in fibers data, but that data isn't actually used for produced component stack (_debugSource
field points to place where <Slice>
is actually used in my test):
this might be avenue to get correct location in overlay, but I don't want to keep this PR hostage for this
Co-authored-by: Lennart <lekoarts@gmail.com>
…s for createPage and createSlice
…reason for if/else for previous react versions
3055b95
to
56f8069
Compare
Description
This implements #36339 minus the "Using the Filesystem"
Documentation
Documentation for this feature is part of
V5 docs
Related Issues
[sc-55262]