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

errorLoadRemote doesn't trigger #2817

Closed
5 tasks done
rrosenshain-sc opened this issue Aug 2, 2024 · 2 comments
Closed
5 tasks done

errorLoadRemote doesn't trigger #2817

rrosenshain-sc opened this issue Aug 2, 2024 · 2 comments

Comments

@rrosenshain-sc
Copy link
Contributor

rrosenshain-sc commented Aug 2, 2024

Describe the bug

Using MF core 0.3.3 and the webpack plugin.

When I point the remoteEntry to a non-existing remoteEntry (eg https://doesnotexists.com/remoteEntry.js) I expect the errorLoadRemote hook in the runtime plugin to get called but it never fires so I can't handle the error.

Instead, I get a uncaught promise exception coming from here:

Unable to use the ${name}'s '${entry}' URL with ${remoteEntryKey}'s globalName to get remoteEntry exports.

My config is pretty much:

function windowRuntimePlugin() {
  return {
    name: 'window-url-runtime-development-plugin',
    errorLoadRemote(args) {
      console.log('ERROR LOADING REMOTE!');
      if (args.lifecycle === 'onLoad') {
        const fallback = 'fallback';
        return fallback;
      } else if (args.lifecycle === 'beforeRequest') {
        return args;
      }
    }
...,
 // webpack.config.js
  new ModuleFederationPlugin({
    name: 'myapp',
      remotes: {
      ['my-remote']: `my_remote@https://somewhereovertherainbow.com/remoteEntry.js`,
    },
    runtimePlugins: [require.resolve('@shared/build/src/moduleFederation/windowRuntimePlugin.development.js')],
  }),

Reproduction

TBD

Used Package Manager

npm

System Info

sh: envinfo: command not found

Validations

@ScriptedAlchemy
Copy link
Member

See: #2672

@rrosenshain-sc
Copy link
Contributor Author

Closing as dupe of #2672

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

2 participants