Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(nextjs-mf): added nextjs-ssr-manifest example #4231

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

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