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
module federation shared #13451
Comments
For maintainers only:
|
Sorry, not related to webpack, this error from vue, better to ask vue community how better to implement this, here example for vu3 https://github.com/module-federation/module-federation-examples/tree/master/vue3-demo (maybe help) |
give you another example:
import axios from "axios";
export default function () {
console.log(axios.defaults.timeoutErrorMessage);
}
import axios from "axios";
axios.defaults.timeoutErrorMessage = "hello";
import("./local").then((v) => {
v.default();
});
import("core/remote").then((v) => {
v.default();
});
import axios from "axios";
export default function () {
console.log(axios.defaults.timeoutErrorMessage);
} {
...
shared: ["axios"],
}; output:
expect:
is my understanding of the "shared" field wrong? Or where else do I need to configure? |
Modify |
Vue3 has the same problem |
it means you need search place where you use two copies vue, maybe you have it in global scope |
End problem first, "shared" field should be configured for all project. // bootstrap.ts;
import { createApp } from "vue";
import App from "./App";
createApp(App).mount("#app"); // main.ts
import("./bootstrap"); |
Bug report
What is the current behavior?
Vue does not use the same source.
If the current behavior is a bug, please provide the steps to reproduce.
type the text
What is the expected behavior?
output:
and no error.
Other relevant information:
webpack version: 5.37.1
Node.js version: 14.16.1
Operating System: windows10
Additional tools: vue2
The text was updated successfully, but these errors were encountered: