You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Version 11.21.0 breaks firebase deploy functions compatibility with pnpm #5448
Replace <project_id> in ./functions/package.json with a valid project id that you have premission to deploy
Run pnpm run deploy this will deploy the function in ./functions/src to the specified firebase project
[REQUIRED] Expected behavior
One callable function named handler ist deployed to the firebase project.
[REQUIRED] Actual behavior
The deploy fails with
In the console:
The system cannot find the path specified.
In the firebase-debug.log:
[debug] [2023-01-21T08:28:14.281Z] Error: spawn C:\Users\bamio\Desktop\firebase_tools_bug\node_modules\.pnpm\[email protected][email protected]\node_modules\.bin\firebase-functions ENOENT
at notFoundError (C:\Users\bamio\Desktop\firebase_tools_bug\node_modules\.pnpm\[email protected]\node_modules\cross-spawn\lib\enoent.js:6:26)
at verifyENOENT (C:\Users\bamio\Desktop\firebase_tools_bug\node_modules\.pnpm\[email protected]\node_modules\cross-spawn\lib\enoent.js:40:16)
at cp.emit (C:\Users\bamio\Desktop\firebase_tools_bug\node_modules\.pnpm\[email protected]\node_modules\cross-spawn\lib\enoent.js:27:25)
at ChildProcess._handle.onexit (node:internal/child_process:291:12)
When downgrading firebase-tools to the previous version 11.20.0 this works just fine. You can test this in the same repsoirtoy by running pnpm install [email protected] in ./functions
This might have somthing to do with #5391 but I am not entirly sure.
Reacted by Jonas Earendel, Daniel Hampton and Hamiiid
This also affects the emulators. If you use pnpm and try to start the emulators on 11.21.0 you get
....path_to_project..../node_modules/.pnpm/[email protected][email protected]/node_modules/.bin/firebase-functions ENOENT
at Process.ChildProcess._handle.onexit (node:internal/child_process:283:19)
at onErrorNT (node:internal/child_process:478:16)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
Error: An unexpected error has occurred.
Perhaps a test case needs to be added to check if all 3 major package managers (npm, pnpm, yarn) work correctly before releases go out?
Reacted by Laurent Payot, Jonas Earendel and Iestyn Lloyd
Similar problem here, on MacBook M1 macOs Ventura, node 18.13.0, pnpm 7.26, using emulator
Error in console:
Error: An unexpected error has occurred.
In firebase.log:
[debug] [2023-01-25T21:34:24.652Z] Building nodejs source
[debug] [2023-01-25T21:34:24.653Z] Could not find functions.yaml. Must use http discovery
[debug] [2023-01-25T21:34:24.656Z] Error: spawn /Users/jonas/Programmering/wow/bakhjarl/functions/node_modules/.pnpm/[email protected][email protected]/node_modules/.bin/firebase-functions ENOENT
at ChildProcess._handle.onexit (node:internal/child_process:283:19)
at onErrorNT (node:internal/child_process:476:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
not just deploys, it also breaks emulator support. Current workaround for me is to run npm install inside the dist folder after output and before emulation or deploys.
If the list of deps is small, it's fine, but large deps become a problem.
Best alternative while we wait would be to:
revert firebase-tools to version 11.20.0,
use a script to symlink the workspace-level node_modules to dist/node_modules of the workspace.
this way we don't have to spend any time for installing, no matter the size
I use the following script for symlinking, (because I don't know how to symlink in linux directly)
Usage: node symlink.mjs node_modules dist/node_modules
Activity
evelant commentedon Jan 21, 2023
This also affects the emulators. If you use pnpm and try to start the emulators on
11.21.0you getPerhaps a test case needs to be added to check if all 3 major package managers (npm, pnpm, yarn) work correctly before releases go out?
laurentpayot commentedon Jan 23, 2023
Confirmed. Cannot run emulators anymore with firebase-tools v11.21.0 and pnpm v7.25.1. I’m getting the same unexpected error as @evelant.
tofsjonas commentedon Jan 25, 2023
Similar problem here, on MacBook M1 macOs Ventura, node 18.13.0, pnpm 7.26, using emulator
Error in console:
In firebase.log:
No problems with 11.20
DibyodyutiMondal commentedon Jan 28, 2023
not just deploys, it also breaks emulator support. Current workaround for me is to run
npm installinside thedistfolder after output and before emulation or deploys.If the list of deps is small, it's fine, but large deps become a problem.
Best alternative while we wait would be to:
node_modulestodist/node_modulesof the workspace.this way we don't have to spend any time for installing, no matter the size
I use the following script for symlinking, (because I don't know how to symlink in linux directly)
Usage:
node symlink.mjs node_modules dist/node_modulessymlink.mjs
Fix broken pnpm support for cf3 (#5467)
Fix broken pnpm support for cf3 (#5467)
evelant commentedon Jan 31, 2023
@taeold Is there going to be a release for this? I'm blocked by it at the moment and can't roll back to an earlier version due to #4952
taeold commentedon Feb 1, 2023
@evelant Released today at v11.22.0!
ChromeQ commentedon Feb 1, 2023
@taeold Success! 🎉 I can successfully run the emulator and deploy WITHOUT having to install deps inside the
functionsdir on v11.22.0.Thank you so much for persevering and getting it fixed! 🙏