-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Labels
Description
Related issues
No related issues found.
The capability was added through the firebase/firebase-functions#1519
[REQUIRED] Version info
node: v20.11.0
firebase-functions: v4.9.0
firebase-tools: v13.7.2
firebase-admin: v12.0.0
[REQUIRED] Test case
- Create a new event trigger function for
onDocumentCreatedWithAuthContext
- Build the code if using typescript
- Run the emulators
- Watch it fail to run the emulators
The error returned from firebase-tools is:
[warn] ! Unexpected rules runtime error: Exception in thread "main" java.lang.NullPointerException: Cannot invoke "String.length()" because "line" is null
at com.google.firebase.rules.tools.local.server.Server.processRequestsFromInputStream(Server.java:75)
at com.google.firebase.rules.tools.local.server.Server.start(Server.java:57)
at com.google.firebase.rules.tools.local.FirebaseRulesTooling.main(FirebaseRulesTooling.java:81)
{"metadata":{"emulator":{"name":"storage"},"message":"Unexpected rules runtime error: Exception in thread \"main\" java.lang.NullPointerException: Cannot invoke \"String.length()\" because \"line\" is null\r\n\tat com.google.firebase.rules.tools.local.server.Server.processRequestsFromInputStream(Server.java:75)\r\n\tat com.google.firebase.rules.tools.local.server.Server.start(Server.java:57)\r\n\tat com.google.firebase.rules.tools.local.FirebaseRulesTooling.main(FirebaseRulesTooling.java:81)\r\n"}}
[info] i logging: Stopping Logging Emulator {"metadata":{"emulator":{"name":"logging"},"message":"Stopping Logging Emulator"}}
[error]
[error] Error: HTTP Error: 500, [object Object]
[debug] [2024-04-13T13:44:30.399Z] Error Context: {
"body": {
"error": {
"code": 500,
"status": "UNKNOWN"
}
},
"response": {
"statusCode": 500
}
}
Inspecting the java error shows the issue:
Unsupported eventType: google.cloud.firestore.document.v1.created.withAuthContext; Supported ones: [google.cloud.firestore.document.v1.created, google.cloud.firestore.document.v1.deleted, google.cloud.firestore.document.v1.updated, google.cloud.firestore.document.v1.written]
[REQUIRED] Steps to reproduce
As above
[REQUIRED] Expected behavior
Either:
- Warning in the emulator output that it is not supported and not load it and continue with emulating the rest
- Emulate the new Firestore triggers (Preferred)
[REQUIRED] Actual behavior
Errors are returned on emulator start. Have to disable new functions to get emulators to run.
Were you able to successfully deploy your functions?
Not relevant to this error as it relates to the emulators
nickichi, benomatis, JanKubicek and MutatedGamer