I'm having some major issues with my firebase functions. I'm trying to create an https
request so that I can send data to Firebase.
I have a super simple code just to test, and it's causing errors:
Here is my code (there should be no problem with this code):
exports.fetchPosts = functions.https.onRequest((req, res) => {
console.log(req)
res.send("Hello!")
})
my index.ts
file is 700 lines long.. without fetchPosts
it deploys perfectly fine.. with fetchPosts
I get these errors..
Here is the error:
! functions: failed to create function fetchPosts
HTTP Error: 400, The request has errors
and here is the verbose error message:
[2019-06-22T16:09:13.362Z] <<< HTTP RESPONSE 400 vary=X-Origin, Referer, Origin,Accept-Encoding, content-type=application/json; charset=UTF-8, date=Sat, 22 Jun 2019 16:09:11 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="46,44,43,39", accept-ranges=none, connection=close [2019-06-22T16:09:13.362Z] <<< HTTP RESPONSE BODY code=400, message=The request has errors, status=INVALID_ARGUMENT, details=[@type=type.googleapis.com/google.rpc.BadRequest, fieldViolations=[field=runtime, description=Runtime field cannot be empty.]] ! functions: failed to create function fetchPosts HTTP Error: 400, The request has errors
Any ideas what the issue might be? This seems ridiculous, as the code literally should work.
firebase deploy --only functions
, but it's producing that error. If I remove thefetchPosts
function from the code it deploys perfectly fine – Simon