Next.js dynamic routes throw errors during build
13 posts since Jun 2023, all from GitHub.
“Link to the code that reproduces this issue https://github.com/umair mirza/pakcrunch new/blob/main/src/app/sitemap.ts To Reproduce I have created a dynamic sitemap for my Nextjs 15 app in the following path: src app sitemap.ts I have created the sitemap according to the example…”
“Link to the code that reproduces this issue https://codesandbox.io/p/sandbox/peaceful smoke yw6tz9?file=%2Fapp%2F(sitemap)%2Fsitemap%2F%5Bslug%5D%2Froute.ts%3A6%2C1 To Reproduce Current vs. Expected behavior Actual result code should reach console.log('fn body called') but…”
“Verify canary release [X] I verified that the issue exists in the latest Next.js canary release Provide environment information Which area(s) of Next.js are affected? (leave empty if unsure) App Router Link to the code that reproduces this issue or a replay of the bug…”
Users encounter errors when building Next.js applications with dynamic routes, particularly when using features like 'use cache' or 'dynamicParams'. The build process fails unexpectedly, halting deployment.
SOURCES (13)
“Link to the code that reproduces this issue https://github.com/umair mirza/pakcrunch new/blob/main/src/app/sitemap.ts To Reproduce I have created a dynamic sitemap for my Nextjs 15 app in the following path: src app sitemap.ts I have created the sitemap according to the example quoted in the Nextjs documentation:…”
“Link to the code that reproduces this issue https://github.com/cantemizyurek/next js dynamic io bug report To Reproduce Create a dynamic route [id] and put this code inside and try to build application. Throws error I think it should not be throwing. And works as expected in dev mode. Current vs. Expected behavior Not to throw errors when building Provide environment information Which area(s) are affected? (Select all that apply) dynamicIO Which stage(s) are affected? (Select all that apply) nex”
“Link to the code that reproduces this issue https://github.com/chriskuech/next catch repro To Reproduce Repro case 1. Run npm run build 2. (The build fails) Control case 1. Comment out the .catch(() = null) in page.tsx 2. Run npm run build 3. (The build succeeds) Current vs. Expected behavior Expected: next compiler sees that Home calls a function triggerRepro that contains cookies() and therefore marks the code as dynamic. Observed: By calling .catch(() = null) on triggerRepro() , next compiler”
“Link to the code that reproduces this issue https://github.com/joshuabaker/nextjs issue route get during build To Reproduce Create a route.js or route.ts file with a GET method. Insert a fetch call. Example Current vs. Expected behavior The build often fails as the method is executed, meaning certain env vars, target paths, etc. are not present. Provide environment information Which area(s) are affected? (Select all that apply) Not sure Which stage(s) are affected? (Select all that apply) next b”
“Link to the code that reproduces this issue https://github.com/kcrwfrd/next.js pages build error reproduction To Reproduce Then I added a useRouter() call to my pages/index.tsx . (fwiw just a fresh reproduction template pages template already suffered some of these errors you see, but adding the useRouter() call reproduced the same Error: NextRouter was not mounted error that I was trying to troubleshoot in my original app). Current vs. Expected behavior Static pages are expected to successfully”
“Link to the code that reproduces this issue https://github.com/Txhawks/missing chunk error To Reproduce The reproduction imports a Foo component using next/dynamic . When the network request to foo.js fails, the whole app comes down crashing. 1. Navigate to https://missing chunk error.vercel.app/ 2. In the Network tab in the dev tools, block the request for 201.e0005a340046428d.js 3. Reload the page, which will result in a ChunkLoadError: Loading chunk 38 failed. client side error. This isn't li”
“Link to the code that reproduces this issue https://github.com/Javad9s/nextjs dynamic params cached notfound/ To Reproduce 1. Build and start the application ( npm run build , npm start ) 2. Open http://localhost:3000/params/aa = calls notfound() , also caches the result 3. Refresh the page = returns the same result 4. Open http://localhost:3000/params/bb = calls notfound() , caches a new page 5. Open http://localhost:3000/params/cc = calls notfound() , caches a new page 6. Open ... This way the”
“Link to the code that reproduces this issue https://github.com/leof240/chunk load error nextauth nextintl To Reproduce 1. build the project 2. deploy on prod server 3. go to a dynamic locale page like http:site/en 4. the page is showing an error on chunk load error Current vs. Expected behavior Current: In development the site is working as expected. in a production build and production environment, the site is throwing a Chunk Load Error on the page js file behind Screenshot 2024 02 24 at 12 47”
“Link to the code that reproduces this issue https://codesandbox.io/p/sandbox/peaceful smoke yw6tz9?file=%2Fapp%2F(sitemap)%2Fsitemap%2F%5Bslug%5D%2Froute.ts%3A6%2C1 To Reproduce Current vs. Expected behavior Actual result code should reach console.log('fn body called') but instead we get Expected result notice that base become https, https://localhost:3000/sitemap/test which is incorrect. it should be without https, https://localhost:3000/sitemap/test Verify canary release [X] I verified that th”
“Link to the code that reproduces this issue https://github.com/silkcoder/nextjs demo To Reproduce I have a route /products/[id] I have a page.js under /products/[id] to load product details When I access this route, I get following message on screen Application error: a client side exception has occurred (see the browser console for more information). When I check console I see following message webpack 20fbacf1cd4b3f42.js:1 GET xxxxxxxxxx/ next/static/chunks/app/products/%5Bid%5D/page 5a69da7f8”
Link to the code that reproduces this issue https://github.com/akshitkrnagpal/nextjs custom errors bug To Reproduce 1. Create file [id]/page.tsx in app directory. 2. Visit /500 or /404 Current vs. Expected behavior Current Behaviour…
“Verify canary release [X] I verified that the issue exists in the latest Next.js canary release Provide environment information Which area(s) of Next.js are affected? (leave empty if unsure) App Router Link to the code that reproduces this issue or a replay of the bug https://github.com/JuandaGarcia/pre rendering bug nextjs To Reproduce 1. Download the code from the repository https://github.com/JuandaGarcia/pre rendering bug nextjs 2. Run npm install , npm run build and npm start in the project”
“Verify canary release [X] I verified that the issue exists in the latest Next.js canary release Provide environment information Which area(s) of Next.js are affected? (leave empty if unsure) No response Link to the code that reproduces this issue or a replay of the bug https://github.com/rijk/repro handler routing To Reproduce 1. Go to https://repro handler routing.vercel.app/b/test.txt 2. Note header x vercel cache: STALE (no matter the age) 3. Reload, observe timestamp changing Describe the Bu”
