Next.js Discord

Discord Forum

Catch All route also catches static assets

Unanswered
Sun bear posted this in #help-forum
Open in Discord
Sun bearOP
I have a catch-all route
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