-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[vitest] require() of ES Module @angular/core/fesm2022/core.mjs not supported #9376 #10511
Comments
The above issue seems to happen with However, if I change the import to
|
Hi @andreialecu thanks for writing in! Interesting, I've seen this before with vitest in other SDKs of ours (specifically Svelte). First off, The good news is that we're currently working on a new major version of our SDKs (v8), meaning we'll be able to drop support for older Angular versions. Our plan for now is to probably go to Angular 14 or 15, depending on these compatibility issues. Also, we'll merge I'll keep this issue open for now as it represents a specific problem with the current package. However, realistically, we can't fix this on v7. Apologies for that. |
Thanks for looking into this. Please see my second comment here, it appears something else is wrong with angular-ivy which is probably a different issue that can be fixed. |
So it seems like the problem is that we're missing an
to the Btw, thanks for providing a reproduction! 🙏 I'll try throwing this into the package and testing with NG12 to 17 again. If this works, we can backport this to our v7 branch. Again, the actual solution here is to bump to a newer Angular version and stick to the package format of that Angular version. For context, this is the APF specification for Angular 15. |
Just a note that adding What is more likely, is needing to reach If you'd like to provide a 'catch-all', it should address both package.json and deep imports, and it should be as simple as adding: To confirm that it works, testing if |
@andreialecu you mean like this?
generally, I'd argue that anyone doing deep imports must expect things to break but if it's as simple as that, we can do it |
Yes, that should do the trick. That should also cover |
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/angular
SDK Version
7.99.0
Framework Version
No response
Link to Sentry event
No response
SDK Setup
No response
Steps to Reproduce
Repro at:
https://stackblitz.com/edit/vitest-dev-vitest-b9tqx7?file=package.json,test%2Fbasic.test.ts%3AL3
Expected Result
No error.
Actual Result
I'm attempting to migrate a test suite to vitest as per: https://analogjs.org/docs/features/testing/vitest#manual-installation and
@sentry/angular
seems to prevent this because as soon as it is imported, Vite will complain about:This was reported previously here: #9376 but in a different context
The text was updated successfully, but these errors were encountered: