Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: specify the region for the SSR function in Web Frameworks #5154

Closed
pothos-dev opened this issue Oct 21, 2022 · 14 comments
Closed

Comments

@pothos-dev
Copy link

pothos-dev commented Oct 21, 2022

[REQUIRED] Environment info

firebase-tools: 11.15.0

Platform: Ubuntu

[REQUIRED] Test case

(omitted)

[REQUIRED] Steps to reproduce

I added a NextJS project to an existing Firebase project with a Default GCP resource location in europe-west3, then enabled the webframeworks experiment, and tried to deploy the project.

[REQUIRED] Expected behavior

The CLI should create a cloud function to process SSR for NextJS. This cloud function should be created in the default GCP resource location, in this case europe-west3

[REQUIRED] Actual behavior

The SSR cloud function is deployed to us-central1, and the deployment fails:

i  functions: creating Node.js 16 function firebase-frameworks-educom-beta:ssrmytestproject(us-central1)...
Failed to replace Run service projects/educom-beta/locations/us-central1/services/ssrmytestproject

Functions deploy had errors with the following functions:
        firebase-frameworks-educom-beta:ssrmytestproject(us-central1)
Function URL (firebase-frameworks-educom-beta:ssrmytestproject(us-central1)): https://ssrmytestproject-jvujsx44zq-uc.a.run.app
i  functions: cleaning up build files...

Error: There was an error deploying functions
@pothos-dev pothos-dev added the bug label Oct 21, 2022
@google-oss-bot
Copy link
Contributor

This issue does not have all the information required by the template. Looks like you forgot to fill out some sections. Please update the issue with more information.

@inlined
Copy link
Member

inlined commented Oct 26, 2022

Support for setting a region other than us-central1 is coming. I do not suspect it will be automatic because Cloud Functions for Firebase already has the existing behavior of defaulting to us-central1 and it will likely have unforeseen consequences to default just the SSR function to the AppEngine region.

@inlined inlined changed the title WebFramework Hosting does not follow Default GCP resource location Feature request: specify the region for the SSR function in Web Frameworks Oct 26, 2022
@aaronSig
Copy link

aaronSig commented Dec 7, 2022

Is there any way to manually work around this in the meantime?

@Erfa
Copy link

Erfa commented Dec 27, 2022

Would definitely appreciate this. Doesn't have to be automatic, just a field in firebase.json would be great.

@nidegen
Copy link

nidegen commented Jan 6, 2023

Yes that would be great indeed!

@qwezey
Copy link

qwezey commented Jan 8, 2023

Agreed. A much-needed feature!

@qwezey
Copy link

qwezey commented Jan 8, 2023

found the culprit:

// TODO allow this to be configurable
region: [DEFAULT_REGION],

seems like this feature is planned for sometime in the future

@davidrayc
Copy link

I was able to change the region in the functions.yaml file inside ./firebase/<my site>. I can only do it though in a very short window during firebase deploy, right after it recreates the yaml file (usually right after next build completes) and before it uploads it to the cloud.

Had to do it because I don't want to pay for another vpc serverless in us-central1 since I already have one in another region. I could just reuse that for the ssr function. Quite a hacky solution but works well for me.

@jamesdaniels
Copy link
Member

Will be addressed once d6826ee is out the door in the next CLI release.

@jasan-s
Copy link

jasan-s commented Mar 15, 2023

@jamesdaniels i'm deploying next js app with the following firebase.json using firebase tools 11.24.1 and evertime the ssr cloud function deploys to us-central1

{
	"hosting": {
		"target": "webapp",
		"source": ".",
		"cleanUrls": true,
		"region": "us-west1",
		"ignore": ["firebase.json", "**/.*", "**/node_modules/**"]
	}
}

UPDATE: The following worked

{
	"hosting": {
		"target": "webapp",
		"source": ".",
		"cleanUrls": true,
		"frameworksBackend": { "region": "us-west1" },
		"ignore": ["firebase.json", "**/.*", "**/node_modules/**"]
	}
}

@jalexw
Copy link

jalexw commented Apr 8, 2023

Why are the regions locked to us-central1, us-west1, us-east1, europe-west1, and asia-east1 when specifying the hosting.frameworksBackend.region property?

Hoping to use Next.js SSR in northamerica-northeast1...

@luc122c
Copy link

luc122c commented Apr 20, 2023

Why are the regions locked to us-central1, us-west1, us-east1, europe-west1, and asia-east1

@jalexw I asked the same thing here. It's becasue Cloud Functions V2 are only available in those regions.

@indu40
Copy link

indu40 commented May 4, 2023

Why are the regions locked to us-central1, us-west1, us-east1, europe-west1, and asia-east1

@jalexw I asked the same thing here. It's becasue Cloud Functions V2 are only available in those regions.

Cloud Functions Locations tells something else. There are many more on the list. Probably the limitation is just Firebase related?

@gustavopch
Copy link

I'd also like to know what's the current situation, if it's already possible to use other regions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests