I am trying to deploy nuxtjs
app as cloud function on Firebase following this tutorial. I am able to deploy everything (functions and hosting). However, when I try to open the page browser displays Error: could not handle the request
.
In the function logs I see the following error: FATAL Cannot resolve "~/graphql/index.js" from "/workspace/graphql/index.js"
.
The path that fails to be resolved is specified in nuxt.config.js
in serverMiddleware:
serverMiddleware: [{ path: '/graphql', handler: '~/graphql/index.js' }],
I tried using ./
instead of ~/
but it changes nothing. I also tried this approach, but it also makes no change, same error is thrown. Obviously dev server runs correctly.
Although the middleware is a graphql one I don't think it's a graphql problem, so no graphql tag at the moment.
Does anyone know how to set up a nuxt server middleware so that Firebase can resolve it?