-
I cannot find any documentation on how to deploy next.js apps to GAE. There are 2 issues with these deploys:
I've searched high and low but cannot find anything on this. |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 19 replies
-
next.config.js
app.yaml
package.json -> scripts
BONUS POINTSpackage.json -> scripts
.gcloudignore You should only be upload the build folder and public folder to GAE. To prevent uploading source code you should add these lines to the .gcloudignore files.
Dynamic Catch All Route If you are using the dynamic catch all route
Basically GAE doesn't like when files names have
So now the deploy script runs build which removes the existing build folder, builds a new one, then replaces the dynamic all route file names from [...slug].js to [@@@slug].js, deploys the app, and once the app is uploaded GAE runs gcp-build and renames them back to [...slug].js This fix was taken from here and modified #10556 (comment) |
Beta Was this translation helpful? Give feedback.
-
I have created a demo repository https://github.com/bradrisse/nextjs-9-gae-demo |
Beta Was this translation helpful? Give feedback.
-
Has anyone tried using the App Engine static file handler for Nextjs static content? Curious if there is a performance benefit as it should bypass the node server. https://cloud.google.com/appengine/docs/standard/nodejs/serving-static-files |
Beta Was this translation helpful? Give feedback.
-
Anyone have experience of App engine and revalidate in getStaticProps since GAE is read only, I guess that wont work? |
Beta Was this translation helpful? Give feedback.
-
Has anyone noticed a very slow first-page load when deploying to AppEngine standard? Once the server has been launched for the first time in a while - subsequent loads are very fast. I've heard that you can configure a warmup route on standard which can increase speed - but I'm not too sure what I'd put in there. If the app is deployed in AppEngine flex, page loads are very fast. But AppEngine Flex is FAR more expensive. |
Beta Was this translation helpful? Give feedback.
-
Anyone managed to use next/Image on GAE?
which lead to EROFS: read-only file system, unlink errors, since it's not deployed in /tmp Couldn't find where to customize this. |
Beta Was this translation helpful? Give feedback.
-
has anyone been successful with deploying to GAE and getting the images to work? if yes, what's your config? I tried numerous ways and for me after building some images from the domain X load and some don't, with the response: tried it both on the |
Beta Was this translation helpful? Give feedback.
-
is the answer above still valid in 2023 NextJS version 13? |
Beta Was this translation helpful? Give feedback.
next.config.js
app.yaml
package.json -> scripts
"start": "next …