Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Webpack Module Federation Error ScriptExternalLoadError: Loading script failed

My host is throwing this error.

enter image description here

NOTE: I tried accessing this directly in the browser https://localhost:5007/accom-web/dist/js/assets/browser-bundle/remoteEntryTest.js and I'm served the remoteEntryTest.js file.

This is my webconfig in host.

enter image description here

This is webconfig of remote application.

enter image description here

Optimization config for remote application is below.

optimization: {
    runtimeChunk: false,
    emitOnErrors: true,
    splitChunks: {
       minSize: 256000,
       minChunks: 1,
       maxAsyncRequests: 10,
       automaticNameDelimiter: '-',
       cacheGroups: {
           chunks: 'initial',
           .....
       },
    },
    .....
}

I looked at the GitHub issues regarding this too but didn't help much.

https://github.com/module-federation/module-federation-examples/issues/307 https://github.com/module-federation/module-federation-examples/issues/1273 https://github.com/module-federation/module-federation-examples/issues/692

Any suggestions on this how to fix it?

like image 829
hendrixchord Avatar asked Apr 27 '26 03:04

hendrixchord


1 Answers

I had a similar issue with specifying shared dependencies on a remote. I ended up having to disable splitChucks after reviewing your Github references. I'm sure you tried that as well but this got my remote working again recently.

optimization: {
        splitChunks: false,
    },
like image 81
JASKRU Avatar answered May 01 '26 01:05

JASKRU