-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Cannot destructure property 'AsymmetricMatcher'
with deps.inline: true
#2806
Comments
I also have this issue when setting it to ex: {
deps: {
inline: ['vuetify']
}
} |
+1 |
This prevents vitest-dev/vitest#2806 which is broken in the latest version of vitest for now
Found a workaround: inline everything except for vitest deps. {
deps: {
inline:
// TODO: Replace with true once https://github.com/vitest-dev/vitest/issues/2806 is fixed.
[/^(?!.*vitest).*$/],
},
}, |
Actually, I just commented the whole inline out and it works.
|
Tamagui monorepo stuck on 0.27 due to this, you can pretty easily clone and |
I've tested this issue with various vitest releases and find out that 0.27.3 works while 0.28.0 doesn't. The only possible change made between them is the merge of #2721 done in 482b72f , which:
But the default inlining conifg of vitest/packages/vitest/src/node/config.ts Lines 15 to 22 in baf902a
So when run with It should add @vitest/* packages when inlining as @Leksat said: const extraInlineDeps = [
/^(?!.*(?:node_modules)).*\.mjs$/,
/^(?!.*(?:node_modules)).*\.cjs\.js$/,
// Vite client
/vite\w*\/dist\/client\/env.mjs/,
// Nuxt
'@nuxt/test-utils',
+ // @vitest packages due to #2721
+ [/^(?!.*vitest).*$/],
] Maybe this regex is too board and need to be narrowed down, but the smoking gun of this issue is here. |
I disagree. It should not be needed to inline Vitest at all. It should not be needed to inline any dependency to be honest. One of the reason why it takes so long to fix is because we will introduce another way to fix dependency issues and this usage of inline will probably be deprecated. The fact that we allow |
@sheremet-va Sorry for my misunderstanding. So I reorganized timeline which appears to be:
So I guess we should avoid using |
this needs to be fixed. |
Please, consider using
|
@sheremet-va We currently need to perform transforms on code within |
optimizer inherits options from |
@sheremet-va With 0.32.0, I haven't yet dived in to see what the issue is, but it feels like it might be related (?). |
Do you use Your issue probably happens because of this: #3544 |
No, we specify dependencies to inline by name/regexp. That certainly looks like the issue to track - thank you. ❤️ |
I got deps.inline doesn't work and I'm almost losing faith after multiple hours of trying either to exclude or inlude this dependency |
|
Where do I need to add this ? |
Update: I removed @react-spectrum and change my InputDate with native function. Problem fixed :) |
I don't use the I tried using this trick but it didn't work for me: {
deps: {
inline:
// TODO: Replace with true once https://github.com/vitest-dev/vitest/issues/2806 is fixed.
[/^(?!.*vitest).*$/],
},
}, I'm not sure if this could be related but I only noticed this error after switching to an Apple Silicon Mac |
This can also happen when using the export default defineConfig({
ssr: {
noExternal: /.*/,
},
}) I was able to fix it by excluding Vite: export default defineConfig({
ssr: {
noExternal: /^(?!.*\/vitest\/).*$/,
},
}) |
Describe the bug
I found that tests are broken after upgrading
vitest
from 0.27.1 to 0.28.4The error is gone if I comment out the
deps.inline
setting: https://github.com/Leksat/vitest-AsymmetricMatcher-issue/blob/3d77d1d5e4b1e86f49e314234db835656388b0f6/vite.config.ts#L8Reproduction
https://stackblitz.com/edit/vitest-dev-vitest-6a5vwn?file=vite.config.ts (I just added
deps.inline: true
to the standard example)Or a minimal reproduction:
System Info
Used Package Manager
pnpm
Validations
The text was updated successfully, but these errors were encountered: