Skip to content

Conversation

benmarch
Copy link

@benmarch benmarch commented Jul 7, 2024

This is a clone of the nextjs-ssr example, but it uses mf-manifest.json instead of remoteEntry.js. Requires changes from this PR: module-federation/core#2726

This requires some CORS config to allow the manifest to be fetched from the browser. I just added the following to the NextJS config in each app, but there are other ways to do it:

// next.config.js

module.exports = {
  headers() {
    return [
      {
        source: '/_next/static/chunks/mf-manifest.json',
        headers: [
          {
            key: 'Access-Control-Allow-Origin',
            value: '*',
          },
        ],
      }
    ]
  },
  //...
}

@CLAassistant
Copy link

CLAassistant commented Jul 7, 2024

CLA assistant check
All committers have signed the CLA.

Copy link

github-actions bot commented Jul 7, 2024

Workflow status is failure ❌
Unfortunately test report wasn't generated, it can be if no workspaces changed. Please check the workflow run below.
Link to GitHub workflow: Github Workflow Link

@github-actions github-actions bot added the workflow-failure Workflow is failed label Jul 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
workflow-failure Workflow is failed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants