-
Notifications
You must be signed in to change notification settings - Fork 903
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
JSON parsing error when running firebase init #4616
Comments
Hi, When you actually use firebase init command, do you use an existing project? In this case, you should check your Realtime Database rules directly in your firebase console, because Firebase Init will try to copy it in local. Try to delete all comments in. |
Try to add an EOF in your json rules. (7th empty line) |
Workaround I used to get around this. Grab the Realtime DB rules from your console, and create a Then run |
This should be resolved in Duplicate #4596 |
[REQUIRED] Environment info
firebase-tools: 11.0.1
Platform: Windows
[REQUIRED] Test case
firebase init
[REQUIRED] Steps to reproduce
firebase init
inside a projectFirestore: Configure security rules and indexes files for Firestore
[REQUIRED] Expected behavior
A json document containing database rules will be written to the project.
[REQUIRED] Actual behavior
n JSON parsing error occurs.
Logs:
? What file should be used for Realtime Database Security Rules? database.rules.json
[2022-06-05T04:05:03.019Z] >>> [apiv2][query] GET https://<MY-APP>-default-rtdb.firebaseio.com/.settings/rules.json [none]
[2022-06-05T04:05:03.773Z] <<< [apiv2][status] GET https://<MY-APP>-default-rtdb.firebaseio.com/.settings/rules.json 200
[2022-06-05T04:05:03.773Z] <<< [apiv2][body] GET https://<MY-APP>-default-rtdb.firebaseio.com/.settings/rules.json
"{\n /* Visit https://firebase.google.com/docs/database/security to learn more about security rules. */\n \"rules\": {\n \".read\": false,\n \".write\": false\n }\n}"
Error: Unable to parse JSON: SyntaxError: Unexpected token / in JSON at position 4
The text was updated successfully, but these errors were encountered: