You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@vue/test-utils provides module field, that is resolved by bundlers, but if I import library with native node (or vitest, that used native node module resolution), then imported module will be in cjs (/dist/vue-test-utils.cjs). Other issue is that all files have the same extension (js), which is not supported by Node (For reference: https://github.com/sheremet-va/dual-packaging).
This leads to @vue/test-utils importing cjs version of Vue in Vitest, which fails the tests (with --no-threads), because it was already required() when defining plugin.
To Reproduce
import{mount}from'@vue/test-utils'// leads to cjs.js
Expected behavior
import{mount}from'@vue/test-utils'// leads to esm.mjs
@vue/test-utils needs an exports field, so Node will correctly resolve paths:
Describe the bug
@vue/test-utils
providesmodule
field, that is resolved by bundlers, but if I import library with native node (or vitest, that used native node module resolution), then imported module will be in cjs (/dist/vue-test-utils.cjs
). Other issue is that all files have the same extension (js
), which is not supported by Node (For reference: https://github.com/sheremet-va/dual-packaging).This leads to
@vue/test-utils
importing cjs version of Vue in Vitest, which fails the tests (with--no-threads
), because it was alreadyrequired()
when defining plugin.To Reproduce
Expected behavior
@vue/test-utils
needs anexports
field, so Node will correctly resolve paths:And
mjs
extension on esm files (will require twicking bundling process).Related information:
@vue/test-utils
version: anyVue
version: not relevantnode
version: not relevantnpm
(oryarn
) version: not relevantAdditional context
The text was updated successfully, but these errors were encountered: