[Vuejs]-Firebase init – Error: Unexpected rules format .rules

0👍

It looks like your firebase.json configuration file points to a file with invalid database security rules. Since firebase deploy tries to deploy everything you’ve configured in your firebase.json file, this causes the deployment to fail.

The simplest way to avoid the problem is to tell the Firebase CLI to only deploy to Firebase Hosting with:

firebase deploy --only hosting

The better fix is probably to figure out why the file contains illegal contents, and either fix that or remove it altogether (if you’re not using the database, or don’t want to use the CLI to deploy the rules)/

0👍

Unfortunately, I didn’t build my npm project before hosting. After running npm run build I was able to deploy the app with firebase deploy --only hosting.

Leave a comment