-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
[swc-angular-plugin] Issue with Dexie package #325
Labels
bug
Something isn't working
Comments
kroeder
changed the title
[swc-angular-plugin] Issue with Dexie-package
[swc-angular-plugin] Issue with Dexie package
Apr 12, 2024
Hi @kroeder, sorry for the late reply, I missed the notification. It seems to be an issue with SWC handling default imports along with destructured imports because in the import Dexie, { liveQuery } from 'dexie'; with: import { Dexie, liveQuery } from 'dexie'; or: import Dexie from 'dexie';
const { liveQuery } = Dexie; then it passes: I played a bit with the SWC configuration and it turns out that if you set the noInterop flag: transform: {
'^.+\\.(ts|mjs|js)$': ['@swc/jest', {
module: {
noInterop: true
},
// ...
}],
} the |
This solved it for us, thanks a lot! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey,
we currently switch from jest (ts-jest) to swc-angular and encountered a few issues.
One of them being that the "Dexie" package cannot be used anymore
I assumed this is related to cjs vs mjs but whatever I tried with moduleNameMapper, ignoreTransformPattern and everything else I usually do if I enocunter these errors, nothing helped.
So this might either be a bug in
swc-angular-plugin
or something I'm doing wrong?It's at least a "regression" since it has worked before and does not now by only following the installation instructions in this package.
Reproduction
https://github.com/kroeder/jest-angular-swc-dexie-reproduction
npm install
nx test
The text was updated successfully, but these errors were encountered: