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 }}
This repository was archived by the owner on Mar 11, 2026. It is now read-only.
If @google-cloud/logging-min or @google-cloud/logging is bundled (say, via esbuild), it crashes at runtime as the instrumentation code wants to access package.json.
Error: Cannot find module '/package.json'
Require stack:
- /workspace/index.js
- /layers/google.nodejs.functions-framework/functions-framework/node_modules/@google-cloud/functions-framework/build/src/loader.js
- /layers/google.nodejs.functions-framework/functions-framework/node_modules/@google-cloud/functions-framework/build/src/main.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:956:15)
at Function.Module._load (node:internal/modules/cjs/loader:804:27)
at Module.require (node:internal/modules/cjs/loader:1028:19)
at require (node:internal/modules/cjs/helpers:102:18)
at getNodejsLibraryVersion (/node_modules/.pnpm/@[email protected]/node_modules/@google-cloud/logging-min/src/utils/instrumentation.ts:193:20)
at createDiagnosticEntry (/node_modules/.pnpm/@[email protected]/node_modules/@google-cloud/logging-min/src/utils/instrumentation.ts:115:31)
at populateInstrumentationInfo (/node_modules/.pnpm/@[email protected]/node_modules/@google-cloud/logging-min/src/utils/instrumentation.ts:87:18)
at Log.write (/node_modules/.pnpm/@[email protected]/node_modules/@google-cloud/logging-min/src/log.ts:980:18)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at logger2 (/lib/logging-gcloud.js:44:12)
If
@google-cloud/logging-minor@google-cloud/loggingis bundled (say, via esbuild), it crashes at runtime as the instrumentation code wants to accesspackage.json.nodejs-logging/src/utils/instrumentation.ts
Lines 189 to 199 in 90bb09f
getNodejsLibraryVersionshould be inlined during build-step.Environment details
@google-cloud/loggingversion: 10.2.0Steps to reproduce
await log.write(entry)