Home > Enterprise >  Firebase Cloud Functions cannot read nitro generated index.mjs file
Firebase Cloud Functions cannot read nitro generated index.mjs file

Time:09-02

EDIT:

I want to deploy a Nuxt3 app to Firebase Hosting. I've set the deployment preset for Nitro to "firebase" NITRO_PRESET=firebase, and the build step works fine. However, when I run firebase deploy, I get an error saying:

There was an error reading .output/server/package.json: 
.output/server/index.js does not exist, can't deploy Cloud Functions

I checked the .output/server directory, and saw that Nitro generated a file called index.mjs. I checked to see if Cloud Functions also works with .mjs files, but that doesn't seem to be the case. I looked for possible solutions but couldn't find anything; I tried reinstalling my modules, but no luck. Do I have something misconfigured or broken?

I'm following this tutorial: enter image description here

Then run the command and it will deploy the application to Firebase hosting and functions.

You can read more about this in the documentation.

  • Related