next.js: Dynamic catch-all routes not supported in Google App Engine
Issue with filename-name causing deploy error in Google App Engine
Describe the bug
I’ve had a nextJS app running in the Google App Engine enviroment for a while. Works splendid and fast - however, I added a dynamic route and now I am unable to deploy due to the filename being unsupported (due to the 3 dots).
Error from the Gcloud CLI:
ERROR: (gcloud.app.deploy) INVALID_ARGUMENT: Filename cannot contain '.', '..', '\r', start with '-', '_ah/', or '\n': pages/[...slug]/index.js.
One fix could be using underscore or similar instead, like “[___slug]”
To Reproduce
Deploy the app to Google App Engine using any boilerplate configuration for app.yaml with a dynamic catch all route. Use below example and add a catch-all page.
https://github.com/superbmeteor/nextjs-gae-demo
Expected behavior
Should deploy successfully.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 16
- Comments: 19 (2 by maintainers)
Same problem here! It’s blocking our project at the moment.
I’m running into this problem right now as well. Any known workarounds would be greatly appreciated
@Timer Google has fixed this on their end now. Closing issue.
I made the following workaround and it seems to work fine.
Invoke
yarn gcp-predeployafter building and before deploying to change...to@@@for uploading. Thegcp-buildsteps renames it back on the app-engine instance. A small disadvantage of having agcp-buildstep is that all dependencies are installed (including dev) for thegcp-buildstep and then cleared and then again for thestartstep, slightly increasing instance startup time. Note that we cannot rename inside thestartscript as the file system is read-only at that time.I’m also having this problem. The problem only occurs on the App Engine Standard environment.