Firebase-tools: Firebase database emulator crashes when using with bolt rules

Created on 5 Nov 2020  路  2Comments  路  Source: firebase/firebase-tools

Running firebase start:emulator doesn't seem to support bolt file anymore.

Environment info

firebase-tools v8.15.0 on Mac (it was working with 8.6.0)

Steps to reproduce

  1. Write some bolt rules
  2. Configure it in your firebase.json file:
    json { "database": { "rules": "./packages/app-database/rules/realtime.bolt" } }
  3. Run firebase emulators:start --only database --debug

It crashes with:

[2020-11-05T14:34:23.171Z] <<< HTTP RESPONSE 400 {"content-length":"38","content-type":"application/json; charset=utf-8","access-control-allow-origin":"*","cache-control":"no-cache","x-firebase-project-id":"projectId","x-firebase-project-number":"","x-firebase-uuid":""}
[2020-11-05T14:34:23.171Z] <<< HTTP RESPONSE BODY {
  "error" : "5:1: Parse error.\n"

Expected behavior

Firebase should parse the bolt file before updating the rule in the emulator.

Actual behavior

It crashes.

emulator-suite database bug

Most helpful comment

@SamyPesse thanks for reporting this! You're right, we had not considered this situation properly. We'll need to make the rules loader compile bolt rules.

All 2 comments

This issue does not seem to follow the issue template. Make sure you provide all the required information.

@SamyPesse thanks for reporting this! You're right, we had not considered this situation properly. We'll need to make the rules loader compile bolt rules.

Was this page helpful?
0 / 5 - 0 ratings