When deploying with ng deploy
or firebase deploy
, I encounter the following error:
Error: Your project must be on the Blaze (pay-as-you-go) plan to complete this command. Required API
artifactregistry.googleapis.com
can’t be enabled until the upgrade is complete. To upgrade, visit the following URL:
After some research, I discovered that I need to upgrade if I want to use cloud functions. However, I do not wish to do so, even though it keeps creating a functions folder. Additionally, I have no intention of using artifactregistry.googleapis.com
, nor am I aware of what it is and how it was installed in my project.
I attempted to deploy using firebase deploy --only hosting
, but encountered the same result.
EDIT :
I attempted to delete the folder .firebase/functions
, but it keeps getting recreated every time I run firebase deploy –only hosting.
firebase.json file :
{
"hosting": {
"source": ".",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"frameworksBackend": {
"region": "europe-west1"
}
},
"firestore": {
"rules": "firestore.rules",
"indexes": "firestore.indexes.json"
}
}
2
Answers
When I ran
ng new
, I didn't pay much attention and enabled SSR (Server-Side Rendering), which requires activating cloud functions.In summary, SSR rendering is not compatible with the Firebase Spark plan.
An issue with the Blaze plan and the Artifact Registry API is occurring for you. You can attempt the following actions if you’re not using Cloud Functions or Artifact Registry and don’t wish to upgrade to the Blaze plan:
Delete the functions folder
: You can safely delete the functions folder from your project if you’re not utilizing Cloud Functions. When you establish a project with Firebase CLI, this folder is automatically created; however, if you are only using Firebase Hosting, you do not need to create it.https://firebase.google.com/docs/hosting/quickstart
Examine your firebase.JSON document:
Verify that there are no references to Cloud Functions or the Artifact Registry in your firebase.json file. You can get rid of them if it does.Deploy only hosting:
You indicated that you attempted to use the firebase deploy –only hosting command, which is the appropriate one to use for deploying just the project’s hosting portion. If the mistake persists, though, it may be because of the previously mentioned issues.Verify the settings for your project:
Select your project from the Firebase dashboard and look over the project settings. Verify that no services or APIs are enabled that aren’t necessary.Recall that Google Cloud Platform offers a service called the Artifact Registry API for managing and storing packages and containers. If you’re not using it on purpose, it may have been activated by default when you used a particular command or service, or when you first started your Firebase project.
If you’ve verified all of these things and the error persists, kindly give more information about how your project is configured and the precise commands you’re using. This will enable me to provide you with a more precise answer.