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

fix: import .mjs version of vue-composition-api #105

Merged
merged 1 commit into from Oct 27, 2021

Conversation

neelance
Copy link
Contributor

I do not know if this is a good solution in general, but it fixed the build for us.

After upgrading @vue/composition-api our own code was importing vue-composition-api.mjs into the bundle, but @vueuse/core via vue-demi imported vue-composition-api.esm.js. This bundling of two different modules lead to the [vue-composition-api] must call Vue.use(VueCompositionAPI) error.

@antfu
Copy link
Member

antfu commented Sep 27, 2021

I would on hold this for a while. Even tho I believe this is the right thing to do eventually, I am afraid that the existing community still needs some time to catch up (vuejs/composition-api#815)

The current workaround might be setting the alias manually:

alias: {
  '@vue/composition-api/dist/vue-composition-api.esm.js': '@vue/composition-api/dist/vue-composition-api.mjs'
}

This was referenced Oct 9, 2021
@antfu antfu changed the title import .mjs version of vue-composition-api fix: import .mjs version of vue-composition-api Oct 27, 2021
@antfu antfu merged commit 0e6b88e into vueuse:master Oct 27, 2021
@raygence13
Copy link

I would on hold this for a while. Even tho I believe this is the right thing to do eventually, I am afraid that the existing community still needs some time to catch up (vuejs/composition-api#815)

The current workaround might be setting the alias manually:

alias: {
  '@vue/composition-api/dist/vue-composition-api.esm.js': '@vue/composition-api/dist/vue-composition-api.mjs'
}

could you elaborate on where/which file this alias is supposed to be applied?

@sattes-faction
Copy link

In your webpack config file.

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

Successfully merging this pull request may close these issues.

None yet

4 participants