Skip to content

Missing types in @sentry/profiling-node #12468

Closed
@jstarmx

Description

@jstarmx

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/node

SDK Version

8.9.1

Framework Version

Node 21.4.0

Link to Sentry event

No response

SDK Setup

No response

Steps to Reproduce

  1. Create a new project
npm init
  1. Install dependencies
npm i typescript @sentry/profiling-node
  1. Add a tsconfig.json
{
    "compilerOptions": {
        "strict": true
    }
}
  1. Create a file and import the module
import { nodeProfilingIntegration } from '@sentry/profiling-node';

Expected Result

Types are found

Actual Result

Types are not found. Error message in VS Code:

Could not find a declaration file for module '@sentry/profiling-node'. '/Users/[redacted]/sentry-types/node_modules/@sentry/profiling-node/lib/cjs/index.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/sentry__profiling-node` if it exists or add a new declaration (.d.ts) file containing `declare module '@sentry/profiling-node';`

Looking at the package.json file in the module, it specifies lib/types/index.d.ts for the types:

{
  ...
  "types": "lib/types/index.d.ts",
  "exports": {
    "./package.json": "./package.json",
    ".": {
      "import": {
        "types": "./lib/types/index.d.ts",
        "default": "./lib/esm/index.js"
      },
      "require": {
        "types": "./lib/types/index.d.ts",
        "default": "./lib/cjs/index.js"
      }
    }
  },
  ...
}

However there is no file at that location.

Screenshot 2024-06-11 at 23 14 28

Metadata

Metadata

Assignees

Type

Projects

Status

Waiting for: Product Owner

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions