question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

v0.12.0 import mjs issue

See original GitHub issue

I upgrade @vue/composition-api from 1.1.5 to 1.2.4, and it emit error.

Error: [vue-composition-api] must call Vue.use(VueCompositionAPI) before using any function

I checked it babel jsx plugin imported @vue/composition-api/dist/vue-composition-api.mjs, but vue-demi imported @vue/composition-api/dist/vue-composition-api.esm.js.

So I think it should be changed to .mjs as well.

https://github.com/vuejs/composition-api/blob/a5a68e0e35321bf9d508c0a3046560112579de9b/package.json#L20

https://github.com/vueuse/vue-demi/blob/077cdb8c30307fd0093bc3bd290997b34001a672/lib/v2/index.mjs#L2

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
antfucommented, Oct 28, 2021

Now in @vue/composition-api v1.3.0, it should export .mjs by default. If everything works correctly you might no longer need the alias. See https://github.com/vuejs/composition-api/releases/tag/v1.3.0 for more details.

2reactions
Shinigami92commented, Oct 28, 2021

@sxzz Thank you, that works:

  resolve: {
    alias: [
      { find: '@', replacement: resolve(__dirname, './src') },
      { find: /^@vue\/composition-api$/, replacement: '@vue/composition-api/dist/vue-composition-api.mjs' }
    ]
  }
Read more comments on GitHub >

github_iconTop Results From Across the Web

Upgrade Angular 12 to 13 - Compile error in mjs file
Upgrade Angular 12 to 13 - Compile error in mjs file · try to deleting node_module folder and angain in type reinstall it...
Read more >
Modules: Packages | Node.js v19.3.0 Documentation
It can load JSON modules, but an import assertion is required. It accepts only .js , .mjs , and .cjs extensions for JavaScript...
Read more >
Migration Guide - KaTeX
v0.14.0. With module loaders that support conditional exports and ECMAScript modules, import katex from 'katex'; will import the ECMAScript module.
Read more >
Frequently asked questions — Vuetify
Vuetify utilizes Typescript and currently must import and extend the Vue object. ... v0.12.0. How do I report a bug or request a...
Read more >
Resolve the "Unable to import module" error for Lambda code ...
Last updated: 2021-12-01. I receive the "Unable to import module" error when I try to run my AWS Lambda code in Node.js.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found