Skip to content

server-side-rendering without server side rendering #4331

@evgeniya-ch

Description

@evgeniya-ch

Actual result:

<body>
<div id="root">
  <div>
    <div style="background-color:black;color:lightgrey;padding:1rem">
      <h1>Module Federation Example: Server Side Rendering</h1>
      <h2>This is the shell application.</h2>
    </div>
    <!--$!--><template></template><h1>Loading....</h1><!--/$-->
  </div>
</div>
<script async data-chunk="main" src="http://localhost:3000/static/main.js"></script>
</body>

Expected result:

<body>
<div id="root">
  <div>
    <div style="background-color:black;color:lightgrey;padding:1rem">
      <h1>Module Federation Example: Server Side Rendering</h1>
      <h2>This is the shell application.</h2>
    </div>
    <div style="background-color: green; color: lightgrey; padding: 1rem;">
      <h2>Remote 1: Content</h2>
      <p>This is the content from remote 1, which will include an image component exposed by
        remote2. This demonstrates nested federated modules being rendered server-side.</p>
      <div style="background-color: red; color: lightgrey; padding: 1rem; width: 500px;">
        <h2>Remote 2: Image</h2>
        <button style="margin-bottom: 1rem;">Click me to test i'm interactive!</button>
        <img src="https://i.ibb.co/jfTvC6Q/serge.jpg" alt="serge" border="0" style="width: 100%;">
      </div>
    </div>
  </div>
</div>
<script async data-chunk="main" src="http://localhost:3000/static/main.js"></script>
</body>

On server error:
Image

Client work normal:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions