Skip to content

[Bug]: rspack cant host vite #309

@yanirmanor

Description

@yanirmanor

Describe the bug

Versions

Rspack -
"@module-federation/enhanced": "^0.15.0",
"@rspack/cli": "1.4.0-beta.1",
"@rspack/core": "1.4.0-beta.1",

"@module-federation/vite": "^1.5.0",
"vite": "^6.3.5"

Reproduction

https://github.com/yanirmanor/mf-vite-rm-vite-rspack-host

Steps to reproduce

When using only vite to vite everything works.
but when try to use vite as remote and rspack as host
then getting error
how to fix
Script error.
at handleError (http://localhost:8080/main.js:18765:64)
at http://localhost:8080/main.js:18789:13
ERROR
[ Federation Runtime ]: remoteEntryExports is undefined
{
"alias": "remote",
"name": "remote",
"entry": "http://localhost:5173/remoteEntry.js",
"externalType": "script",
"shareScope": "default",
"type": "global",
"entryGlobalName": "remote"
}
while loading "./remote-app" from webpack/container/reference/remote
Error: [ Federation Runtime ]: remoteEntryExports is undefined
{
"alias": "remote",
"name": "remote",
"entry": "http://localhost:5173/remoteEntry.js",
"externalType": "script",
"shareScope": "default",
"type": "global",
"entryGlobalName": "remote"
}
at error (http://localhost:8080/main.js:19260:11)
at assert (http://localhost:8080/main.js:19252:9)
at Module.getEntry (http://localhost:8080/main.js:20502:9)
at async Module.get (http://localhost:8080/main.js:20512:36)
at async RemoteHandler.loadRemote (http://localhost:8080/main.js:21854:37)
at async Promise.all (index 0)

Version

V1.5.0

Reproduction

https://github.com/yanirmanor/mf-vite-rm-vite-rspack-host

Relevant log output

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    COMMUNITY: PR is welcomedWe think it's a good feature to have but would love for the community to help with the PR for itbugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions