I am using angular(7) cli for my app. I recently added sentry integration into the app and when I build prod I am getting an error:
ERROR in ./node_modules/@sentry/utils/esm/is.js
Module build failed (from ./node_modules/@angular-devkit/build-optimizer/src/build-optimizer/webpack-loader.js):
Error: File lib.dom.d.ts does not have a sourceFile.
at Object.getSourceFile (/Users/shurikag/PRIZ/dev/priz-fe/node_modules/@angular-devkit/build-optimizer/src/helpers/transform-javascript.js:86:23)
at findSourceFile (/Users/shurikag/PRIZ/dev/priz-fe/node_modules/typescript/lib/typescript.js:87549:29)
at /Users/shurikag/PRIZ/dev/priz-fe/node_modules/typescript/lib/typescript.js:87457:85
at getSourceFileFromReferenceWorker (/Users/shurikag/PRIZ/dev/priz-fe/node_modules/typescript/lib/typescript.js:87424:34)
at processSourceFile (/Users/shurikag/PRIZ/dev/priz-fe/node_modules/typescript/lib/typescript.js:87457:13)
at processRootFile (/Users/shurikag/PRIZ/dev/priz-fe/node_modules/typescript/lib/typescript.js:87287:13)
at /Users/shurikag/PRIZ/dev/priz-fe/node_modules/typescript/lib/typescript.js:87763:21
at Object.forEach (/Users/shurikag/PRIZ/dev/priz-fe/node_modules/typescript/lib/typescript.js:210:30)
at processLibReferenceDirectives (/Users/shurikag/PRIZ/dev/priz-fe/node_modules/typescript/lib/typescript.js:87758:16)
at findSourceFile (/Users/shurikag/PRIZ/dev/priz-fe/node_modules/typescript/lib/typescript.js:87598:17)
at /Users/shurikag/PRIZ/dev/priz-fe/node_modules/typescript/lib/typescript.js:87457:85
at getSourceFileFromReferenceWorker (/Users/shurikag/PRIZ/dev/priz-fe/node_modules/typescript/lib/typescript.js:87424:34)
at processSourceFile (/Users/shurikag/PRIZ/dev/priz-fe/node_modules/typescript/lib/typescript.js:87457:13)
at processRootFile (/Users/shurikag/PRIZ/dev/priz-fe/node_modules/typescript/lib/typescript.js:87287:13)
at /Users/shurikag/PRIZ/dev/priz-fe/node_modules/typescript/lib/typescript.js:86300:60
at Object.forEach (/Users/shurikag/PRIZ/dev/priz-fe/node_modules/typescript/lib/typescript.js:210:30)
[31mERROR in ./node_modules/@sentry/utils/esm/misc.js
Module build failed (from ./node_modules/@angular-devkit/build-optimizer/src/build-optimizer/webpack-loader.js):
Error: File lib.dom.d.ts does not have a sourceFile.
at Object.getSourceFile (/Users/shurikag/PRIZ/dev/priz-fe/node_modules/@angular-devkit/build-optimizer/src/helpers/transform-javascript.js:86:23)
at findSourceFile (/Users/shurikag/PRIZ/dev/priz-fe/node_modules/typescript/lib/typescript.js:87549:29)
at /Users/shurikag/PRIZ/dev/priz-fe/node_modules/typescript/lib/typescript.js:87457:85
at getSourceFileFromReferenceWorker (/Users/shurikag/PRIZ/dev/priz-fe/node_modules/typescript/lib/typescript.js:87424:34)
at processSourceFile (/Users/shurikag/PRIZ/dev/priz-fe/node_modules/typescript/lib/typescript.js:87457:13)
at processRootFile (/Users/shurikag/PRIZ/dev/priz-fe/node_modules/typescript/lib/typescript.js:87287:13)
at /Users/shurikag/PRIZ/dev/priz-fe/node_modules/typescript/lib/typescript.js:87763:21
at Object.forEach (/Users/shurikag/PRIZ/dev/priz-fe/node_modules/typescript/lib/typescript.js:210:30)
at processLibReferenceDirectives (/Users/shurikag/PRIZ/dev/priz-fe/node_modules/typescript/lib/typescript.js:87758:16)
at findSourceFile (/Users/shurikag/PRIZ/dev/priz-fe/node_modules/typescript/lib/typescript.js:87598:17)
at /Users/shurikag/PRIZ/dev/priz-fe/node_modules/typescript/lib/typescript.js:87457:85
at getSourceFileFromReferenceWorker (/Users/shurikag/PRIZ/dev/priz-fe/node_modules/typescript/lib/typescript.js:87424:34)
at processSourceFile (/Users/shurikag/PRIZ/dev/priz-fe/node_modules/typescript/lib/typescript.js:87457:13)
at processRootFile (/Users/shurikag/PRIZ/dev/priz-fe/node_modules/typescript/lib/typescript.js:87287:13)
at /Users/shurikag/PRIZ/dev/priz-fe/node_modules/typescript/lib/typescript.js:86300:60
at Object.forEach (/Users/shurikag/PRIZ/dev/priz-fe/node_modules/typescript/lib/typescript.js:210:30)
What am I going wrong? I didn't find anything on the web that directed me to the right direction.
Downgrading to sentry 5.6.3 resolved the issue.
npm uninstall @sentry/browser -S
npm install @sentry/[email protected] -S
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With