module-federation / core

Module Federation is a concept that allows developers to share code and resources across multiple JavaScript applications
https://module-federation.io/
MIT License
1.27k stars 182 forks source link

i try to use init() and app cant find it #2668

Open pouryaghazizadeh opened 1 week ago

pouryaghazizadeh commented 1 week ago

Describe the bug

i have a react app as host and try to connect to the remote module that is a next app. in my host app try to use init() and i getting this error

Screenshot 2024-06-25 at 22 52 33
// Bootstrap.ts
import { init ,preloadRemote} from "@module-federation/enhanced/runtime";

init({
  name: '@demo/app-main',
  remotes: [
    {
      name: "auth",
      entry: "http://localhost:3200/_next/static/chunks/mf-manifest.json",
    }
  ],
  plugins: [
    // dynamicplugin()
  ]
});
preloadRemote([
  {
    nameOrAlias: 'auth',
    exposes: [],
  },
]);

`

### Reproduction

https://github.com/pouryaghazizadeh/chat-app

### Used Package Manager

pnpm

### System Info

```shell
macbook air M1

 "@module-federation/enhanced": "^0.2.1",

Validations

ScriptedAlchemy commented 1 week ago

Repo is not public, please provide repo

github-actions[bot] commented 1 week ago

Hello @pouryaghazizadeh. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with need reproduction will be closed if they have no activity within 5 days.

pouryaghazizadeh commented 4 days ago

Repo is not public, please provide repo Hi, it is public now .