You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
offline integration requires typescript dom lib in integration package #2877
The recently added offline integration (#2778) depends on the TypeScript dom lib, which cannot be safely included in node.js projects due to incompatible interface definitions, such as Timers.
I found an existing mention of this problem, but no issue tracking it yet:
It may help to remove dom from that shared file and only include dom in the browser package to avoid this problem.
Reacted by Steve Ortiz, Kiran Thomas, Christiaan Kortekaas, Kirill Groshkov, Sergey Mitskevich, Angus Fretwell, Marko Kajzer, Brandon, Brandon Erbschloe, Christopher Chow and 1 more
@jstewmon since I added the Offline integration, I would be happy to help out here if possible. Do you have an example of how to reproduce this problem?
If you run npm i && npx tsc -b, you'll see the errors. The only way around it currently is to enable skipLibCheck to avoid checking the dom types referenced by localforage.
@HazAT@voraciousdev@kamilogorek The sentry packages have been essentially unusable in typescript projects targeting node for 2 months now. Is there any plan to remediate this issue?
Reacted by Sergey Mitskevich, Andrés Reyes Monge, mdornseif, Brandon, Zach Silveira, Brandon Erbschloe, Kiran Thomas and Jonathan Dierckens
Just chiming in here to say that we tried to upgrade to latest version this morning in our Typescript project and cannot do so because of the dom lib issue. Hoping for a timely resolution as there are a lot of fixes between 5.19.x (which we're on) and latest.
@kirillgroshkov I think we were able to get around this by adding dom to the tsconfig#compilerOptions in our project:
"compilerOptions": {
"lib": [
"dom"
]
}
I know this doesn't work for everyone, but it solved the errors we were seeing like:
node_modules/localforage/typings/localforage.d.ts(65,43): error TS2304: Cannot find name 'Blob'.
node_modules/localforage/typings/localforage.d.ts(67,54): error TS2304: Cannot find name 'Blob'.
After going through this, I don't actually think the issue we were encountering is the same as OP at this point, but I will leave this comment for anyone else that is curious.
Reacted by Kirill Groshkov, Oleg Abrazhaev, Hardik Butani Scaletech and Daniel
I just tested one of the possible solutions to this issue. Basically using Triple-Slash Directive /// <reference lib="dom" /> instead of relying on project config - https://www.typescriptlang.org/docs/handbook/triple-slash-directives.html
The only downside here, is that it will include the built-in typing compilation-wide, not only in this specific file.
Is there an acceptable fix for this that doesn't include adding dom typings? I'm using Sentry in a backend service, adding typings that aren't supported by what's actually available in Node doesn't seem like the right way.
Hi, all. I believe this was fixed in #3508, which was included in v6.3.6. I'm going to close this, but please feel free to comment if you're still having trouble and we can reopen it if necessary.
Activity
davidmyersdev commentedon Sep 9, 2020
@jstewmon since I added the Offline integration, I would be happy to help out here if possible. Do you have an example of how to reproduce this problem?
davidmyersdev commentedon Sep 9, 2020
Not directly related, but previous changes to this piece of the codebase lead to #2868, so we'll want to keep that in mind.
jstewmon commentedon Sep 9, 2020
@voraciousdev sure, I put up a minimal reproduction repo here: https://github.com/jstewmon/sentry-javascript-2877
If you run
npm i && npx tsc -b, you'll see the errors. The only way around it currently is to enableskipLibCheckto avoid checking the dom types referenced by localforage.jstewmon commentedon Nov 9, 2020
@HazAT @voraciousdev @kamilogorek The sentry packages have been essentially unusable in typescript projects targeting node for 2 months now. Is there any plan to remediate this issue?
kirillgroshkov commentedon Nov 10, 2020
We've pinned to
5.21.4(the last working version) about 2 months agobrandonb927 commentedon Jan 12, 2021
Just chiming in here to say that we tried to upgrade to latest version this morning in our Typescript project and cannot do so because of thedomlib issue. Hoping for a timely resolution as there are a lot of fixes between 5.19.x (which we're on) and latest.@kirillgroshkov I think we were able to get around this by adding
domto the tsconfig#compilerOptions in our project:I know this doesn't work for everyone, but it solved the errors we were seeing like:
After going through this, I don't actually think the issue we were encountering is the same as OP at this point, but I will leave this comment for anyone else that is curious.
kirillgroshkov commentedon Jan 12, 2021
Yeah, we're still on
5.21.4as a last working versionkamilogorek commentedon Jan 19, 2021
I just tested one of the possible solutions to this issue. Basically using Triple-Slash Directive
/// <reference lib="dom" />instead of relying on project config - https://www.typescriptlang.org/docs/handbook/triple-slash-directives.htmlThe only downside here, is that it will include the built-in typing compilation-wide, not only in this specific file.
dearsaturn commentedon Apr 26, 2021
Is there an acceptable fix for this that doesn't include adding
domtypings? I'm using Sentry in a backend service, adding typings that aren't supported by what's actually available in Node doesn't seem like the right way.felipeochoa commentedon Sep 1, 2021
Bump from a paying customer
AbhiPrasad commentedon Feb 14, 2022
Hey folks, it's been a while, appreciate all the comments. We'll be addressing this as part of our work in #4240! Added this to the roadmap!
eyal-confetti commentedon Jun 12, 2022
You can close this issue
lobsterkatie commentedon Jun 13, 2022
Hi, all. I believe this was fixed in #3508, which was included in
v6.3.6. I'm going to close this, but please feel free to comment if you're still having trouble and we can reopen it if necessary.