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

Import fails with Vue3 + Vite5 + Vitest #124

Open
ajuvonen opened this issue Oct 17, 2024 · 0 comments
Open

Import fails with Vue3 + Vite5 + Vitest #124

ajuvonen opened this issue Oct 17, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@ajuvonen
Copy link

ajuvonen commented Oct 17, 2024

Description

Apologies for not providing a complete repro, since I'm only currently evaluating the library. But I tried it out mimicking some of the behavior from your Vue example. This, however, makes all the Vitest unit tests in the project to fail with the following message.

TypeError: Cannot read properties of undefined (reading 'defineComponent')
 ❯ node_modules/@fireworks-js/vue/dist/index.umd.js:8:318

 ❯ node_modules/@fireworks-js/vue/dist/index.umd.js:8:235
 ❯ node_modules/@fireworks-js/vue/dist/index.umd.js:8:273

I can get around this by mocking the import of @fireworks-js/vue in my test setups, but is it possible to avoid this?

My code (partial):

import {Fireworks, type FireworksOptions} from '@fireworks-js/vue';

const fireworksOptions: Partial<FireworksOptions> = {
  acceleration: 1,
};

<Fireworks
  :autostart="fireworks"
  :options="fireworksOptions"
  class="modal-dialog__backdrop"
  aria-hidden="true"
/>

My deps:

"@fireworks-js/vue": "^2.10.8",
"vue": "3.5.12",
"vite": "^5.4.9",
"vitest": "^2.1.3",

Which package are you using?

@fireworks-js/vue

fireworks-js version

2.10.8

Browser

Firefox 131

@ajuvonen ajuvonen added the bug Something isn't working label Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants