Skip to content

Package json not found by the cds-plugin #353

@jkaraffa53

Description

@jkaraffa53

Hi team,
i've started to use telemetry library just recently and I've found out running cds tests fails because cds plugin cannot find the package.json

adjusting this line:

const { dependencies } = require(require('path').join(cds.root, 'package'))

to package.json instead of package resolves the problem

Is this a problem in my setup or is there a bug? How can I fix it?

error:

 Cannot find module '/home/jk/bdc-fos/fos-data-subscription-db-svc/app/package' from 'node_modules/@cap-js/telemetry/cds-plugin.js'

    Require stack:
      node_modules/@cap-js/telemetry/cds-plugin.js
      node_modules/@sap/cds/lib/utils/cds-utils.js
      node_modules/@sap/cds/lib/index.js
      test/health-service.test.ts

      at Resolver._throwModNotFoundError (node_modules/jest-resolve/build/index.js:863:11)
      at node_modules/@cap-js/telemetry/cds-plugin.js:31:28

Thanks,
Jan

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions