-
-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NodeJS 16 decommissioned in January #248
Comments
Exac
changed the title
NodeJS 16 Decomission in January
NodeJS 16 decommissioned in January
Sep 6, 2024
Currently, if you switch to NodeJS 18 and run the emulator, you will run into an error caused by esbuild. $ nvm use 18
$ nx build functions
$ node node_modules/firebase-tools/lib/bin/firebase.js emulators:start
i emulators: Starting emulators: auth, functions, firestore, database, hosting, pubsub, storage, eventarc
i firestore: Firestore Emulator logging to firestore-debug.log
✔ firestore: Firestore Emulator UI websocket is running on 9150.
i database: Database Emulator logging to database-debug.log
i pubsub: Pub/Sub Emulator logging to pubsub-debug.log
i hosting[nx-firebase-proj]: Serving hosting files from: packages/nx-firebase-proj-app/public
✔ hosting[nx-firebase-proj]: Local server: http://127.0.0.1:5000
i ui: Emulator UI logging to ui-debug.log
i functions: Watching "/home/exac/example-org/dist/packages/functions" for Cloud Functions...
⚠ functions: package.json indicates an outdated version of firebase-functions. Please upgrade using npm install --save firebase-functions@latest in your functions directory.
⚠ functions: Please note that there will be breaking changes when you upgrade.
⚠ functions: Your requested "node" version "16" doesn't match your global version "18". Using node@18 from host.
i functions: Loaded environment variables from .env, .env.local.
Serving at port 8424
Error: Dynamic require of "util" is not supported
at file:///home/exac/example-org/dist/packages/functions/main.js:12:9
at node_modules/firebase-functions/lib/logger/index.js (file:///home/exac/example-org/dist/packages/functions/main.js:465:18)
at __require2 (file:///home/exac/example-org/dist/packages/functions/main.js:15:51)
at node_modules/firebase-functions/lib/params/types.js (file:///home/exac/example-org/dist/packages/functions/main.js:549:19)
at __require2 (file:///home/exac/example-org/dist/packages/functions/main.js:15:51)
at node_modules/firebase-functions/lib/params/index.js (file:///home/exac/example-org/dist/packages/functions/main.js:872:19)
at __require2 (file:///home/exac/example-org/dist/packages/functions/main.js:15:51)
at node_modules/firebase-functions/lib/common/encoding.js (file:///home/exac/example-org/dist/packages/functions/main.js:960:20)
at __require2 (file:///home/exac/example-org/dist/packages/functions/main.js:15:51)
at node_modules/firebase-functions/lib/v2/providers/https.js (file:///home/exac/example-org/dist/packages/functions/main.js:43834:22)
⬢ functions: Failed to load function definition from source: FirebaseError: Functions codebase could not be analyzed successfully. It may have a syntax or runtime error
┌─────────────────────────────────────────────────────────────┐
│ ✔ All emulators ready! It is now safe to connect your app. │
│ i View Emulator UI at http://127.0.0.1:4000/ │
└─────────────────────────────────────────────────────────────┘
One possible fix is to modify the {
"targets": {
"build": {
"executor": "@nx/esbuild:esbuild",
"options": {
"esbuildOptions": {
"banner":{
"js":"const require = (await import('node:module')).createRequire(import.meta.url);const __filename = (await import('node:url')).fileURLToPath(import.meta.url);const __dirname = (await import('node:path')).dirname(__filename);"
}
}
}
}
}
} That said, this is with just the basic |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
According to the documentation, NodeJS 16 is going to be decommissioned is January:
https://cloud.google.com/functions/docs/runtime-support
The text was updated successfully, but these errors were encountered: