Skip to content
This repository was archived by the owner on May 29, 2026. It is now read-only.
This repository was archived by the owner on May 29, 2026. It is now read-only.

Node.js libraries require @opencensus/propagation-tracecontext but it is not in package.json #23

Description

@aabmass

index.js (for both knex and sequelize integration) requires util.js which requires @opencensus/propagation-tracecontext.

const {TraceContextFormat} = require('@opencensus/propagation-tracecontext');

However, this dep is only in devDependencies atm. OpenCensus or OpenTelemetry are providers for tracestate/traceparent, so the dependency should be optional and only crash if the user passes tracestate/traceparent in their config.

Repro:

$ npm init -y
$ npm install @google-cloud/sqlcommenter-knex
$ node -i "require('@google-cloud/sqlcommenter-knex')"
internal/modules/cjs/loader.js:968
  throw err;
  ^

Error: Cannot find module '/usr/local/google/home/aaronabbott/repo/sqlcommenter/nodejs/sqlcommenter-nodejs/samples/express-opentelemetry/require('@google-cloud/sqlcommenter-knex')'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)
    at Function.Module._load (internal/modules/cjs/loader.js:841:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions