-
Notifications
You must be signed in to change notification settings - Fork 53
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
Slice Simulator Not Rendering the slice #1423
Comments
hey, Thanks for submitting the issue.
|
Hey @r0hitm, It looks like your Next.js application is rendering a "Not Found" page when trying to reach the Slice Simulator page on your website. Can you make sure the simulator page is available on your website? I think you'll need to rearrange your app directory like so: src
├── app
│ ├── (cms)
│ ├── [uid]
+ | ├── slice-simulator
+ │ │ └── page.tsx // With the content of the existing `slice-simulator.tsx` file you might have
│ ├── API
│ ...
│ ├── error.tsx
│ ├── layout.tsx
│ ├── loading.tsx
│ ├── not-found.tsx
│ ├── page.tsx
│ └── tag
├── components
├── prismicio.ts
- ├── slice-simulator
├── slices
└── styles Here's an example of how the Slice Simulator page is setup with the app directory on Next.js if you have any doubt: https://github.com/prismicio-community/nextjs-starter-prismic-minimal/blob/main/src/app/slice-simulator/page.tsx Also, if you'd like to, you should be able to simplify your route resolver using this syntax: const routes: prismic.ClientConfig["routes"] = [
{ type: "page", path: "/:uid" },
{ type: "blog", path: "/blog/:uid" },
]; This maps the UIDs to their Let us know if that helps! |
That worked! Thank you @lihbr! The troubleshooting docs at slice-machine#simulate-slices should be updated to add this information yeah, I was experimenting with the routes before, I will simplify them |
Versions
Reproduction
Not sure, if this will reproduce this but I have set up my project using the prismic docs in Nextjs with app router. I configured the route resolver like this:
And I've
./src/app/[uid]/page.tsx
that renders all of the routes above. I've created a page type and populated on prismic. It was giving me the same error that slice machine cannot render my slices, so I tried with the default RichTextSlice that it generates, and that's still not resolved. I've read and double checked the troubleshooting that it points to here at least 3 times already.Additional Details
Steps to reproduce
Go to any slice and click simulate button.
(PS dev server is running; every config file is defined correctly)
What is expected?
slice-machine should load and successfully render the slice.
What is actually happening?
slice-machine is loading but not rendering the slice.
P.S. Does the placeholder text not appears on the slice-machine from a freshly created slice?
The text was updated successfully, but these errors were encountered: