When deploying my next.js application to Google App Engine (Standard Environment), one specific js chunk cannot be loaded but throws a 404 error and makes the app crash. Happens everytime when I load a specific route for that the chunk is needed.
What is weird though: When I build and deploy the app locally in dev environment, NextJS does serve this specific file without problems. I made sure that this specific file indeed is included in the app build that it is being uploaded (which would also rule out all cache-specific issues like looking for long gone files from earlier builds.)
My current workaround is to serve the files for _next statically via app.yaml. That is working, the 404 error is gone (because the file is in fact there, only next.js won't find or serve it.) Of course I would rather make the next.js server handle it.
- url: /_next
static_dir: build
- url: /.*
secure: always
script: auto
Maybe it has something to do with the dynamic segments in the routes, @modal and [documentId]? I realize that there have been earlier issues with dynamic routes on NextJS but they are said to be fixed.
Thanks in advance for any idea on how to fix this.
