Closed Psycarlo closed 12 months ago
Not sure, but it is likely caused by having "pnpm" as part of your firebase.json config.
Executables in this context, just like package.json scripts, will resolve to installed the node_modules so you should not prefix them with your package manager.
It should be "predeploy": ["turbo build", "isolate"],
Even if with "predeploy": []
, the error is the same
With "predeploy": []
you shouldn't have a build output, no? Then you are maybe deploying whatever is left in your build output from last time...?
Also check that you are actually exporting the functions from the root index file. This error looks familiar. I think it happens when firebase really can not find your code. I suspect it is not related to the build process or isolate
I was able to fix this. I changed my firebase.json
predeploy to:
"predeploy": ["turbo build", "pnpm --dir \"$RESOURCE_DIR\" isolate"],
And also my functions package.json scripts, contain:
"isolate": "npx isolate"
Good to hear that you found a workaround! I still wonder what the root of the problem was though, because you shouldn't need to do that.
If it's code that you are willing to share with me, invite me to your repo and I will take a quick look to see if I can spot anything.
Any clue on why the following is occuring?
Failed to load function definition from source: FirebaseError: Failed to find location of Firebase Functions SDK. Please file a bug on Github
This is when I try to run with emulators.
My setup:
firebase.json
Note: I have my firebase config files at the root of my monorepo
isolate.config.json
apps/functions/package.json
apps/functions/src/index.ts
When I try firebase deploy --only functions, I also get:
Running command: npx isolate npm ERR! could not determine executable to run