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

Vue.utils.warn break build process. #214

Closed
Fnxxxxo opened this issue Feb 16, 2023 · 4 comments
Closed

Vue.utils.warn break build process. #214

Fnxxxxo opened this issue Feb 16, 2023 · 4 comments

Comments

@Fnxxxxo
Copy link

Fnxxxxo commented Feb 16, 2023

I build a component repo with vue.2.7 and vue-demi.0.13.11. The dist artifact is wired with a NPE.
lQLPJxBSESCyRRxozQUZsK_10SXmQKrdA-fd554A-QA_1305_104
It crushes the building process in my vue.3.0 project. Maybe an issue caused by #192 ?

@sonicoder86
Copy link

Coming from vuelidate, the newest version crashes with the above error when using Vue 3 without compatibility mode.

@brunomperes
Copy link

brunomperes commented Mar 22, 2023

I think this is related to it using a .mjs extension webpack/webpack#16000 (comment) and one fix is basically what is applied for .cjs here

Related PR https://github.com/vueuse/vue-demi/pull/219/files

@antfu
Copy link
Member

antfu commented Mar 22, 2023

We temporarily close this due to the lack of enough information.
Please provide a minimal reproduction to reopen the issue.
Thanks.

Why reproduction is required

@antfu antfu closed this as completed Mar 22, 2023
@AMontagu
Copy link
Contributor

AMontagu commented Mar 28, 2023

Hello @antfu

Sorry to not provide a minimal repository as I am not sur you will want to look further about this behavior.

This exception happen to me when using Webpack Module federation (https://webpack.js.org/concepts/module-federation/) in a micro frontend POC.

To avoid the issue:

Shared module is not available for eager consumption: webpack/sharing/consume/default/vue-router/vue-router

I defined the main.js in a bootstrap.js file and in main.js using: import("./bootstrap"); See: https://webpack.js.org/concepts/module-federation/#uncaught-error-shared-module-is-not-available-for-eager-consumption

In vue.config.js I declared:

plugins: [
      new ModuleFederationPlugin({
        name: "app-center",
        shared: {
          ...deps,
          vue: {
            eager: true,
            singleton: true,
          },
        },
      }),
    ],

It worked fine with vue 2.6 and vue-demi 0.6.2 but not working with vue 2.7 and vue-demi 0.13.11.

Look like as the import is async the vue demi load is loaded before vue is instancied and Vue.util is undefined.

If you are willing to look into it I may produce a minimal reproduction but as this is an edge case maybe it's not in your priorities to handle this kind of issues.

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

5 participants