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

ModuleFederation cant share vue-demi correctly #16060

Closed
promer94 opened this issue Jul 16, 2022 · 4 comments
Closed

ModuleFederation cant share vue-demi correctly #16060

promer94 opened this issue Jul 16, 2022 · 4 comments

Comments

@promer94
Copy link

promer94 commented Jul 16, 2022

Bug report

What is the current behavior?
ModuleFederation cant share vue-demi correctly.

Screen Shot 2022-07-16 at 20 06 47

If the current behavior is a bug, please provide the steps to reproduce.

https://github.com/promer94/demi-mf-bug

What is the expected behavior?
vue-demi should be able to access vue

Other relevant information:
webpack version: 5.73.0
Node.js version: 16.5.0
Operating System: MacOS 12.4
Vue version 2.6.14

@promer94
Copy link
Author

Normal build:
normal-build

With mf and shared config
Screen Shot 2022-07-18 at 23 44 18

It seems like that import Vue from 'vue should be convered to vue__WEBPACK_IMPORTED_MODULE_0__['default'] instead of vue__WEBPACK_IMPORTED_MODULE_0__ when using module federation

@hangboss1761
Copy link

Normal build: normal-build

With mf and shared config Screen Shot 2022-07-18 at 23 44 18

It seems like that import Vue from 'vue should be convered to vue__WEBPACK_IMPORTED_MODULE_0__['default'] instead of vue__WEBPACK_IMPORTED_MODULE_0__ when using module federation

@promer94
May I ask how you solved this problem, I also encountered.

@Dreamer-Somebody
Copy link

For me,set webpack alias can solve the problem;

alias: {
    'vue-demi': 'vue-demi/lib/v2/index.cjs',
}

then clear webpack cache(./node_modules/.cache)and reboot your project.

@workkk98
Copy link

mark

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

4 participants