Catch All route also catches static assets
Unanswered
Sun bear posted this in #help-forum
Sun bearOP
I have a catch-all route
I'm using a standalone build.
app/[[...slug]]/page.tsx that fetches data from a headless cms for every page. In development all works fine. In production, however, also static files generated by next (.css, .js) are catched by the route handler. How to make _next/**/* urls not to be handled by the catch all route?I'm using a standalone build.
2 Replies
ngl this sounds like an unintended bug tbh and i think you should report it on github if not there, however a "fix" i can think of is using rewrites and go to subfolder with path regex ignoring that _next dir
Sun bearOP
Thanks! Opened an issue: https://github.com/vercel/next.js/issues/67806