Skip to content

Unknown mark error with Module Federation SSR #210

Open
@eon-lee96

Description

@eon-lee96

Version

Latest

Reproduction link

https://github.com/eon-lee96/my-mf-ssr-example

Steps to reproduce

Just follow the README to run demo

What is actually happening?

For short: nesting import cross two builds

Both Website1 and Website2 have their own imported.js. Website1 consumed a shared component(SomeComponent) from Website2 by using dynamic import. And SomeComponent also import an async component.

In server side, it work as expected----created all marks.

In client side, it cause Error: react-imported-component: unknown mark.
I think this is because the marks on the server side created are inconsistent with the LOADABLE_MARKS in the client bundle.

After calling rehydrateMarks, the LOADABLE_MARKS may be correct, depends on the level of nesting

I have tried my best to solve it (master...eon-lee96:master). It works fine in demo, But i am not sure if this is the best solution

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions