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

Can I use with @module-federation/enhanced as a host application? #640

Open
dante01yoon opened this issue Nov 20, 2024 · 1 comment
Open

Comments

@dante01yoon
Copy link

dante01yoon commented Nov 20, 2024

Versions

For Vite config

  • vite-plugin-federation: v1.3.6
  • vite: 5.0.6

For webpack config

  • @module-federation/enhanced0.7.5

Reproduction

can not import vite remote app in webpack host app.

Not sure this is related with vite plugin, can not use with webpack host app

e:  Error: [ Federation Runtime ]: Failed to get remoteEntry exports. #RUNTIME-001
args: {"remoteName":"myRemoteApp","remoteEntryUrl":"

this is vite config from remote app

federation({
        name: 'myRemoteApp',
        filename: 'remoteEntry.js',
        remotes: {
          'myHostApp': '/resources/something/host',
        },
        exposes: {
          './Spinner': './src/components/Spinner.vue',
        },
        shared: ['vue', 'pinia', 'vue-router'],
      }),

and this is host app actually import - using vue2

import { init, loadRemote } from '@module-federation/runtime';


    const instance = init({
      name: "myHostApp",
      remotes: [
        {
          name: "myRemoteApp",
          entry: "/resources/my-remote-app/assets/remoteEntry.js",
        },
      ]
    })

export default {
  // ... 
  async mounted() {
    const modules = await loadRemote('myRemoteApp/Spinner');
  }
}
e:  Error: [ Federation Runtime ]: Failed to get remoteEntry exports. #RUNTIME-001
args: {"remoteName":"myRemoteApp","remoteEntryUrl":"

Steps to reproduce

What is Expected?

What is actually happening?

@frolovsky
Copy link

frolovsky commented Dec 9, 2024

If you using @module-federation/enhanced you can try @module-federation/vite

See example: webpack + vite: https://github.com/module-federation/vite/tree/main/examples/vite-webpack-rspack

Maybe you should play with the from settings – but I don't think it will help because the host application uses webpack.

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