Skip to content

APM: Could not find a declaration file for module 'express' #2688

Closed
@websmurf

Description

@websmurf

Package + Version

Version:

5.17.0

Description

After adding the APM module to our non-express application, we are receiving the next error when building our VueJS application:

 ERROR  Failed to compile with 1 errors                                                                                                                                                                                                                               1:57:51 PM

 error  in {PROJECTPATH}/node_modules/@sentry/apm/dist/integrations/express.d.ts

ERROR in {PROJECTPATH}/node_modules/@sentry/apm/dist/integrations/express.d.ts(2,29):
2:29 Could not find a declaration file for module 'express'. '{PROJECTPATH}/node_modules/express/index.js' implicitly has an 'any' type.
  Try `npm install @types/express` if it exists or add a new declaration (.d.ts) file containing `declare module 'express';`
    1 | import { Integration } from '@sentry/types';
  > 2 | import { Application } from 'express';
      |                             ^
    3 | /**
    4 |  * Express integration
    5 |  *

 ERROR  Build failed with errors.

We could ofcourse work around this by adding @types/express, but since we do not have an express js application, I would rather not do that.

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