Open Aditya21196 opened 6 years ago
I was experienced the same issue today. I found problem which caused this in my function code. I make mistake in ref path and use js template string style for path variable.
So it was exports.myFunc = functions.database.ref('/my/path/${uid}')
instead exports.myFunc = functions.database.ref('/my/path/{uid}')
.
This is how I resolved it:
this is how i used it : functions.database.ref('/my/path/${uid}')
expected : functions.database.ref(/my/path/{uid}
)
1) Changed ' to ` 2) Removed $ before variable name
This issue can be closed.
I have the same error, this issue is not closed,
your instructions are not clear: Changed ' to ` (what? can you be more clear like x => o (x changed to o) Removed $ before variable name (where, put before and after)
thx!
i´m not sure but i think cloud functions is very tricky, an error always pop up!
Please check your code,
Firebase cannot identify uid variable using '' ( Normal String). If you are trying to assign a variable value to string, you must use {} without ES6 Multiline String(${variableName}
)
Error - Not ${variableName}
exports.myFunc = functions.database.ref('/my/path/${uid}')
Solution - Use only {variableName}
exports.myFunc = functions.database.ref('/my/path/{uid}')
But in this case you are trying to access to dynamic uid you must use normal string with {}
, because firebase will recognize {dynamicUID}
as the id following the path.
Example:
Firebase Structure Users/1234/likes/likeId
Firebase ref to dynamic id on likes Users/{userId}/likes/{likeId}
This issue can be closed.
I had the same issue. It's because I had:
// Note the errant $
fooFunction: db.ref("posts/${userId}").onCreate(...)
instead of
// Note the (correct) lack of $
fooFunction: db.ref("posts/{userId}").onCreate(...)
Firebase, this 405 error is very cryptic, any chance you could improve this error reporting so future users have it a bit easier? :-)
I was deploying functions yesterday but when I closed my node project and reopened it, I was greeted by this error:
Failed to configure Firebase Realtime Database trigger: unknown error, HTTP code 405
Functions deploy had errors. To continue deploying other features (such as database), run: firebase deploy --except functions
Error: Functions did not deploy properly.
I tried using the suggested function but it didn't work either. I tried searching online for solutions but found none.