You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Astro Server-Side Rendered application does not successfully deploy after adding the Node.js adapter
Additional context
How are you using GCP buildpacks?
pack and the gcr.io/buildpacks/builder
Cloud Functions
Cloud Run
Cloud Build
App Engine Standard
App Engine Flex
Did this used to work?
No
What language is your project primarily written in?
Node.js
Steps To Reproduce
Steps to reproduce the behavior:
npm create astro@latest astro-app
cd astro-app
npx astro add node
gcloud run deploy --allow-unauthenticated
Expected behavior
Successfully deployed application, which I am able to get if I follow these steps:
npm create astro@latest astro-app
cd astro-app
npx astro add node
npm pkg set scripts.start="HOST=0.0.0.0 node ./dist/server/entry.mjs"
gcloud run deploy --allow-unauthenticated
Actual behavior
Successful build. Failed deployment to Cloud Run.
Possible fix
Detect Astro for node is enabled by checking if @astrojs/node exists in dependencies in package.json
Confirm the start script is equal to astro dev which starts the development server. If it's not the default, that means the developer has customized it, and we should go with that.
Set the start script to HOST=0.0.0.0 node ./dist/server/entry.mjs. Without HOST=0.0.0.0 the application will try to serve on localhost and that seems to fail on Cloud Run.
Potential reasons to Close as Won't fix
Since the command npx astro add node is still required, it might not truly be considered an "out of the box" deployment
Setting the HOST environment variable within Cloud Run is something we haven't done to deploy other frameworks and could be further than we would like to go in order to support Astro deployments
The text was updated successfully, but these errors were encountered:
Describe the bug
Astro Server-Side Rendered application does not successfully deploy after adding the Node.js adapter
Additional context
How are you using GCP buildpacks?
pack
and thegcr.io/buildpacks/builder
Did this used to work?
No
What language is your project primarily written in?
Node.js
Steps To Reproduce
Steps to reproduce the behavior:
npm create astro@latest astro-app
cd astro-app
npx astro add node
gcloud run deploy --allow-unauthenticated
Expected behavior
Successfully deployed application, which I am able to get if I follow these steps:
npm create astro@latest astro-app
cd astro-app
npx astro add node
npm pkg set scripts.start="HOST=0.0.0.0 node ./dist/server/entry.mjs"
gcloud run deploy --allow-unauthenticated
Actual behavior
Successful build. Failed deployment to Cloud Run.
Possible fix
@astrojs/node
exists independencies
inpackage.json
start
script is equal toastro dev
which starts the development server. If it's not the default, that means the developer has customized it, and we should go with that.start
script toHOST=0.0.0.0 node ./dist/server/entry.mjs
. WithoutHOST=0.0.0.0
the application will try to serve onlocalhost
and that seems to fail on Cloud Run.Potential reasons to Close as Won't fix
npx astro add node
is still required, it might not truly be considered an "out of the box" deploymentHOST
environment variable within Cloud Run is something we haven't done to deploy other frameworks and could be further than we would like to go in order to support Astro deploymentsThe text was updated successfully, but these errors were encountered: