Next.js Discord

Discord Forum

Next14 Dynamic routing error

Unanswered
Dwarf Crocodile posted this in #help-forum
Open in Discord
Avatar
Dwarf CrocodileOP
I'm using next14 for a static page application, and i'm getting the following error in my command line (my project works well thou):

This is my folder structure:
src/app/components
src/app/page.js
src/app/layout.js
src/app/[slug]/page.js

and this is src/app/[slug]/page.js code block:

import { VerticalSlider } from "../components/VerticalSlide"; import { sliderData } from "../data"; export default function Page({ params }) { const { slug } = params; return <VerticalSlider data={sliderData} slug={slug} />; } export async function generateStaticParams() { return sliderData.map((post) => ({ slug: post.id, })); }

PS:
I'm using output: "export" in my next.config;.js
Image

0 Replies