-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Why does this bug appear when I use this vue-cli demo :Reason: ScriptExternalLoadError: Loading script failed. #2066
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
Comments
You may need to modify the configuration of optimization.splitChunks optimization: {
splitChunks: false
} or chainWebpack: config => {
config.optimization.delete('splitChunks')
} |
Output.PublicPath: auto |
Setting any of those options didn't work in the project I started based on the vue-cli demo. |
It's related to webpack trying to load chunks from the wrong url. Usually when public path is set to a relative like / - Audi usually fixes it otherwise you can hard code public path to an absolute location and it should work |
Thanks @ScriptedAlchemy. I've disabled splitChunks and set the publicPath, and it works now. Great! publicPath: 'http://localhost:5001',
transpileDependencies: true,
configureWebpack: {
optimization: {
splitChunks: false,
},
plugins: [
new ModuleFederationPlugin({
name: "products",
filename: "remoteEntry.js",
library: { type: "var", name: "products" },
exposes: {
"./ListingComponent": "./src/components/ProductsListing.vue",
},
}),
],
},
devServer: {
port: 5001,
}, |
Awesome glad to hear |
The text was updated successfully, but these errors were encountered: