Slides create weird error #39214
Replies: 1 comment
-
This issue often happens when a createSlice call defines the slice, but the corresponding is either missing in the component tree or not registered properly within a layout or page template. The error message 'Slice "undefined for "footer" slot not found' typically means that the slice was defined during build (createSlice) but never actually rendered using the component from gatsby. In your case, ensure that the layout or page component that should include the slice explicitly includes at the desired position. Additionally, make sure that the component passed to createSlice (e.g., DummyFooter.tsx) exports a default component correctly and doesn’t rely on TypeScript-only syntax that might not transpile properly in non-TS Gatsby setups. Also, double-check that the path in require.resolve(...) is correct relative to the gatsby-node.js file. If the error persists, try clearing .cache and public (gatsby clean) before re-running the build to ensure the slice registry is refreshed. Let me know if sharing a minimal reproducible repo is possible—happy to take a deeper look. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
hi there,
using Gatsby 5.13.3 in a big typescript project just to render pages from json sources (Gatsby is not migrated to ts). Creating pages is working. Now I try to create a very simple static slide in createPages:
The footer is created in [project]/public/slice-data/footer.json
However, no matter if build or dev, I am always running into an error from [project]/.cache/slice/inline-slice.js:
'Slice "undefined for "footer" slot not found'.
Looks like the sliceMapContext is empty.
Did anybody run into something like this?
Beta Was this translation helpful? Give feedback.
All reactions