Closed
Description
webpack version: 5.20.0
error message
warining: Initialization of sharing external failed: ScriptExternalLoadError: Loading script failed.
error: Uncaught (in promise) ScriptExternalLoadError: Loading script failed.
similar issue: (#307)
I already used syntax like app2: "app2@http://localhost:3002/remoteEntry.js"
, but the browser still report the error.
Here's my config:
app1
app2
other
I am sure I have read shared-routes2
folder in this repo.
The difference between my demo and shared-routes
is this different framework.
I use vue-cli in my demo.
I inspect the generated webpack config:
/* config.plugin('mf') */
// app1
new ModuleFederationPlugin(
{
name: 'app1',
filename: 'remoteEntry.js',
remotes: {
app2: 'app2@http://localhost:8082/remoteEntry.js'
},
exposes: {},
shared: {
vue: {
eager: true,
singleton: true,
requiredVersion: '^2.6.11'
},
'vue-router': {
eager: true,
singleton: true,
requiredVersion: '^3.4.3'
}
}
}
)
// app2
/* config.plugin('mf') */
new ModuleFederationPlugin(
{
name: 'app2',
filename: 'remoteEntry.js',
exposes: {
'./routes': './src/router/index.ts'
},
shared: {
vue: {
eager: true,
singleton: true,
requiredVersion: '^2.6.11'
},
'vue-router': {
eager: true,
singleton: true,
requiredVersion: '^3.4.3'
}
}
}
)
Metadata
Metadata
Assignees
Labels
No labels