Closed as not planned
Closed as not planned
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/angular-ivy
SDK Version
7.81.1
Framework Version
17.0.4
Link to Sentry event
No response
SDK Setup
No response
Steps to Reproduce
- I have updated our project to the latest Angular 17.x version
- I have updated Sentry to the latest version that requires Angular
- I have tried to run the tests and I received a module not found error.
We are using @angular-builders/jest
to run our tests via Jest (the problem surfaces with default configuration).
Steps to reproduce:
- generate a new Angular project
- configure
@angular-builders/jest
following readme - import sentry in the app component
- create a test that imports the app component
- run the test and observe that Jest fails with a module not found import error
Expected Result
Jest tests continue to work without a problem.
Actual Result
Every test fails that references a file that imports Sentry in any way with the following message:
Cannot find module '@sentry/angular-ivy' from '<my-app>/path-to-file-where-sentry-is-imported.ts'
I think the root cause of this problem is the same as reported in this issue:
Tests will start to work again when I revert back the referenced change by adding the main
entry point in the node_modules
folder:
"main": "bundles/sentry-angular-ivy.umd.js",
There is a workaround. The following snippet should be added to the Jest config:
moduleNameMapper: {
'@sentry/angular-ivy': '<rootDir>/node_modules/@sentry/angular-ivy/bundles/sentry-angular-ivy.umd.js',
},
This mandatory workaround should be possibly documented somewhere prominent.
Metadata
Metadata
Assignees
Type
Projects
Status
Waiting for: Product Owner