Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/browser
SDK Version
8.7.0
Framework Version
No response
Link to Sentry event
No response
SDK Setup
No response
Steps to Reproduce
Init a new node project (I used node 20 with yarn 1)
run:
yarn init -y
run:
yarn add typescript@5.4.5 @sentry/browser@8.7.0
create tsconfig.json
:
{
"compilerOptions": {
"strict": true, // changes type warning to error
"moduleResolution": "node16" // causes typescript to use `require` resolution instead of `import`
}
}
create index.ts
:
import * as Sentry from "@sentry/browser";
You'll find that the project can't compile because import * as Sentry from "@sentry/browser";
errors because Could not find a declaration file for module '@sentry/browser'.
This is because the package.json
for '@sentry/browser' (the published version, not the version in this repo) has this exports section:
"exports": {
"./package.json": "./package.json",
".": {
"import": {
"types": "./types/index.d.ts",
"default": "./esm/index.js"
},
"require": {
"types": "./build/npm.types/index.d.ts",
"default": "./cjs/index.js"
}
}
},
which specifies that require
types live at ./build/npm.types/index.d.ts
, but this file doesn't exist.
Maybe related, but the published package.json
doesn't match what's in this repo at time of release. Yikes.
Expected Result
types should work
Actual Result
types don't work
Metadata
Metadata
Assignees
Type
Projects
Status
No status