Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find type definition file for 'react' using @sentry/angular-ivy #9679

Closed
3 tasks done
edgarmcbee opened this issue Nov 27, 2023 · 14 comments
Closed
3 tasks done
Assignees
Labels
Package: angular Issues related to the Sentry Angular SDK Type: Bug

Comments

@edgarmcbee
Copy link

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/angular-ivy

SDK Version

7.82.0

Framework Version

17.0.4

Link to Sentry event

No response

SDK Setup

No response

Steps to Reproduce

ng new
npm i @sentry/angular-ivy
add import * as Sentry from '@sentry/angular-ivy'; to app.component.ts
ng serve

Expected Result

ng serve completes

Actual Result

✘ [ERROR] TS2688: Cannot find type definition file for 'react'. [plugin angular-compiler]

node_modules/@sentry/browser/node_modules/@sentry/types/types/instrument.d.ts:1:22:
  1 │ /// <reference types="react" />
@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 Nov 27, 2023
@github-actions github-actions bot added the Package: angular Issues related to the Sentry Angular SDK label Nov 27, 2023
@AbhiPrasad
Copy link
Member

@amatiash
Copy link

This is not only in @sentry/angular-ivy but also in @sentry/node. Please fix it for @sentry/node as well.

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 Nov 28, 2023
@TelsangVishwanath
Copy link

Is this fixed .?

@debygigradar
Copy link

debygigradar commented Nov 28, 2023

This is not only in @sentry/angular-ivy but also in @sentry/node. Please fix it for @sentry/node as well.

I can confirm, I got this error in the @sentry/node as well

node_modules/@sentry/types/types/instrument.d.ts(1,23): error TS2688: Cannot find type definition file for 'react'.

@debygigradar
Copy link

So, I can finally find a workaround to solve it, just remove the first line in the affected file, in my case node_modules/@sentry/types/types/instrument.d.ts.

I run it inside the docker, so this line of code might help someone, add this right after npm install,

tail -n +2 "node_modules/@sentry/types/types/instrument.d.ts" > "backup.tmp" && mv "backup.tmp" "node_modules/@sentry/types/types/instrument.d.ts"

@swetankrathi
Copy link

swetankrathi commented Nov 28, 2023

Clearly, this is the issue with version 7.82.0. For now, we have downgraded the sentry version to 7.81.1, and it is working fine.

@hcancelik
Copy link

It also occurs in version 7.80.1 of @sentry/node.

@swetankrathi
Copy link

@hcancelik That's weird. If you have tried it on local, try deleting your node_modules directory and do npm cache clean before doing a fresh install.

@hcancelik
Copy link

@swetankrathi I'm also getting the same error locally.

I noticed this yesterday when our deployment Github action started to fail. A new release was published then, so I tried to upgrade to 7.82, but it didn't make any difference.

Screenshot 2023-11-28 at 10 34 17 Screenshot 2023-11-28 at 10 31 45

@swetankrathi
Copy link

@hcancelik Not sure about the node sdk. Our build pipeline started to fail today after the latest version. So, we have downgraded to a minor version. Your packag-lock.json looks fine. Try downgrading to one more minor version.

We faced problem with local as well because the latest version was cached by npm. Deleting node_modules and cleaning the cache worked.

@hcancelik
Copy link

It looks like locking the version to 7.81.1 works for @sentry/nodejs

@lforst
Copy link
Member

lforst commented Nov 28, 2023

Hi everyone, sorry for the inconvenience. We just released version 7.83.0 which includes a fix for this issue.

@lforst
Copy link
Member

lforst commented Nov 28, 2023

Please let us know if this issue persists!

@lforst lforst closed this as completed Nov 28, 2023
@vs-vi
Copy link

vs-vi commented Nov 28, 2023

working like a WoW.

edem-cyber pushed a commit to edem-cyber/sentry-javascript that referenced this issue Nov 30, 2023
This is a hotfix for
getsentry#9679.

We leaked Browser/React types into the generic `@sentry/types` package
which should not have any runtime specific types.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: angular Issues related to the Sentry Angular SDK Type: Bug
Projects
Archived in project
Development

No branches or pull requests

9 participants