Skip to content
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 use VTU-next as a module because it depends on commonjs dependencies #112

Closed
JessicaSachs opened this issue May 7, 2020 · 2 comments

Comments

@JessicaSachs
Copy link
Contributor

Found this when trying to use VTU inside of Vite. Ended up patching the modules.

<script type="module">
import '@vue/test-utils'
</script>

will fail because we depend on two modules that use commonjs exports in our es bundle:

  1. lodash
  2. dom-event-types

The changes I had to make to get them to work are here:
https://github.com/JessicaSachs/vite-component-test-starter/blob/master/patches

To recreate a failure, you can...

  1. clone the vite-starter
  2. remove the patches directory
  3. remove the node_modules
  4. re-install deps
  5. launch the dev server and navigate to /test/index.html
@lmiller1990
Copy link
Member

lmiller1990 commented May 12, 2020

Fixed here #116

Will go out as soon as this is merged. Vite + VTU is amazing!

@lmiller1990
Copy link
Member

Fixed in #116, will release in the next alpha.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants