Skip to content

Conversation

@kitfoster
Copy link
Collaborator

Follow up to

Now the vercel build container supports custom microfrontends.json

@vercel
Copy link

vercel bot commented Oct 27, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
nextjs-app-docs Ready Ready Preview Comment Nov 3, 2025 0:14am
nextjs-app-marketing Ready Ready Preview Comment Nov 3, 2025 0:14am
nextjs-pages-blog Ready Ready Preview Comment Nov 3, 2025 0:14am
nextjs-pages-dashboard Ready Ready Preview Comment Nov 3, 2025 0:14am
react-router-docs Ready Ready Preview Comment Nov 3, 2025 0:14am
react-router-vite-base-path Ready Ready Preview Comment Nov 3, 2025 0:14am
react-router-web Ready Ready Preview Comment Nov 3, 2025 0:14am
single-spa-root Ready Ready Preview Comment Nov 3, 2025 0:14am
single-spa-shared Ready Ready Preview Comment Nov 3, 2025 0:14am
single-spa-web Ready Ready Preview Comment Nov 3, 2025 0:14am
sveltekit-docs Ready Ready Preview Comment Nov 3, 2025 0:14am
sveltekit-web Ready Ready Preview Comment Nov 3, 2025 0:14am

Copy link

@vercel vercel bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Comments:

examples/nextjs-app/marketing/tests/microfrontends.test.ts (line 8):
The test is trying to load ./microfrontends.jsonc, but this file was renamed to microfrontends-custom.jsonc in the changeset. The test will fail when executed because the file no longer exists.

View Details
📝 Patch Details
diff --git a/examples/nextjs-app/marketing/tests/microfrontends.test.ts b/examples/nextjs-app/marketing/tests/microfrontends.test.ts
index e18a3a2..fa47352 100644
--- a/examples/nextjs-app/marketing/tests/microfrontends.test.ts
+++ b/examples/nextjs-app/marketing/tests/microfrontends.test.ts
@@ -5,7 +5,7 @@ import { validateRouting } from '@vercel/microfrontends/next/testing';
 describe('microfrontends', () => {
   test('routing', () => {
     expect(() =>
-      validateRouting('./microfrontends.jsonc', {
+      validateRouting('./microfrontends-custom.jsonc', {
         'nextjs-app-marketing': ['/', '/city/amsterdam', '/flagged/docs'],
         'nextjs-app-docs': [
           '/docs',
diff --git a/examples/nextjs-app/marketing/tests/middleware.test.ts b/examples/nextjs-app/marketing/tests/middleware.test.ts
index bf989cb..3ccf1eb 100644
--- a/examples/nextjs-app/marketing/tests/middleware.test.ts
+++ b/examples/nextjs-app/marketing/tests/middleware.test.ts
@@ -13,13 +13,13 @@ jest.mock('flags/next', () => ({
 describe('middleware', () => {
   test('matches microfrontends paths', () => {
     expect(() =>
-      validateMiddlewareConfig(config, './microfrontends.jsonc'),
+      validateMiddlewareConfig(config, './microfrontends-custom.jsonc'),
     ).not.toThrow();
   });
 
   test('rewrites for flagged paths', async () => {
     await expect(
-      validateMiddlewareOnFlaggedPaths('./microfrontends.jsonc', middleware),
+      validateMiddlewareOnFlaggedPaths('./microfrontends-custom.jsonc', middleware),
     ).resolves.not.toThrow();
   });
 });
diff --git a/examples/nextjs-app/marketing/tests/next-config.test.ts b/examples/nextjs-app/marketing/tests/next-config.test.ts
index 3799ac9..e479186 100644
--- a/examples/nextjs-app/marketing/tests/next-config.test.ts
+++ b/examples/nextjs-app/marketing/tests/next-config.test.ts
@@ -34,7 +34,7 @@ describe('next.config.ts', () => {
 
       it('next.config.js redirects and rewrites should not match any microfrontend path', async () => {
         const mfeConfig = loadMicrofrontendConfigForEdge(
-          './microfrontends.jsonc',
+          './microfrontends-custom.jsonc',
         );
         const allPaths = [...getAllMicrofrontendPaths(mfeConfig)];
         const errors = [];

Analysis

Test references non-existent microfrontends config file

What fails: Tests in examples/nextjs-app/marketing/tests/ reference ./microfrontends.jsonc which no longer exists, causing file not found errors during test execution.

How to reproduce:

cd examples/nextjs-app/marketing
VC_MICROFRONTENDS_CONFIG_FILE_NAME=microfrontends-custom.jsonc pnpm exec jest tests/microfrontends.test.ts

Result before fix:

Error: "ENOENT: no such file or directory, open './microfrontends.jsonc'"
  at loadMicrofrontendConfigForEdge (packages/microfrontends/dist/next/testing.cjs:883:87)
  at validateRouting (packages/microfrontends/dist/next/testing.cjs:1033:79)
  at tests/microfrontends.test.ts:8:49

Expected behavior: The file reference should match the actual filename after the renaming. The file examples/nextjs-app/marketing/microfrontends.jsonc was renamed to examples/nextjs-app/marketing/microfrontends-custom.jsonc in a prior changeset, but test file references were not updated. Updated test files to use the correct filename ./microfrontends-custom.jsonc.

Files modified:

  • examples/nextjs-app/marketing/tests/microfrontends.test.ts
  • examples/nextjs-app/marketing/tests/middleware.test.ts
  • examples/nextjs-app/marketing/tests/next-config.test.ts

All tests now pass successfully.


examples/nextjs-app/marketing/tests/middleware.test.ts (line 16):
The test is trying to load ./microfrontends.jsonc in two places, but this file was renamed to microfrontends-custom.jsonc. The tests will fail when executed because the file no longer exists.

View Details
📝 Patch Details
diff --git a/examples/nextjs-app/marketing/tests/microfrontends.test.ts b/examples/nextjs-app/marketing/tests/microfrontends.test.ts
index e18a3a2..fa47352 100644
--- a/examples/nextjs-app/marketing/tests/microfrontends.test.ts
+++ b/examples/nextjs-app/marketing/tests/microfrontends.test.ts
@@ -5,7 +5,7 @@ import { validateRouting } from '@vercel/microfrontends/next/testing';
 describe('microfrontends', () => {
   test('routing', () => {
     expect(() =>
-      validateRouting('./microfrontends.jsonc', {
+      validateRouting('./microfrontends-custom.jsonc', {
         'nextjs-app-marketing': ['/', '/city/amsterdam', '/flagged/docs'],
         'nextjs-app-docs': [
           '/docs',
diff --git a/examples/nextjs-app/marketing/tests/middleware.test.ts b/examples/nextjs-app/marketing/tests/middleware.test.ts
index bf989cb..3ccf1eb 100644
--- a/examples/nextjs-app/marketing/tests/middleware.test.ts
+++ b/examples/nextjs-app/marketing/tests/middleware.test.ts
@@ -13,13 +13,13 @@ jest.mock('flags/next', () => ({
 describe('middleware', () => {
   test('matches microfrontends paths', () => {
     expect(() =>
-      validateMiddlewareConfig(config, './microfrontends.jsonc'),
+      validateMiddlewareConfig(config, './microfrontends-custom.jsonc'),
     ).not.toThrow();
   });
 
   test('rewrites for flagged paths', async () => {
     await expect(
-      validateMiddlewareOnFlaggedPaths('./microfrontends.jsonc', middleware),
+      validateMiddlewareOnFlaggedPaths('./microfrontends-custom.jsonc', middleware),
     ).resolves.not.toThrow();
   });
 });
diff --git a/examples/nextjs-app/marketing/tests/next-config.test.ts b/examples/nextjs-app/marketing/tests/next-config.test.ts
index 3799ac9..e479186 100644
--- a/examples/nextjs-app/marketing/tests/next-config.test.ts
+++ b/examples/nextjs-app/marketing/tests/next-config.test.ts
@@ -34,7 +34,7 @@ describe('next.config.ts', () => {
 
       it('next.config.js redirects and rewrites should not match any microfrontend path', async () => {
         const mfeConfig = loadMicrofrontendConfigForEdge(
-          './microfrontends.jsonc',
+          './microfrontends-custom.jsonc',
         );
         const allPaths = [...getAllMicrofrontendPaths(mfeConfig)];
         const errors = [];

Analysis

Test files reference non-existent microfrontends.jsonc file

What fails: Three test files reference ./microfrontends.jsonc which no longer exists. The functions validateMiddlewareConfig(), validateMiddlewareOnFlaggedPaths(), validateRouting(), and loadMicrofrontendConfigForEdge() attempt to read the file directly using readFileSync() with no environment variable substitution.

How to reproduce:

cd examples/nextjs-app/marketing
npm test

Result: Tests fail with ENOENT: no such file or directory, open './microfrontends.jsonc' because the file was renamed to microfrontends-custom.jsonc

Expected: Tests should pass by reading the correct file ./microfrontends-custom.jsonc that exists in the directory.

Files affected:

  • examples/nextjs-app/marketing/tests/middleware.test.ts (lines 16, 22)
  • examples/nextjs-app/marketing/tests/microfrontends.test.ts (line 7)
  • examples/nextjs-app/marketing/tests/next-config.test.ts (line 37)

All references updated to use ./microfrontends-custom.jsonc.


examples/nextjs-app/marketing/tests/next-config.test.ts (line 37):
The test is trying to load ./microfrontends.jsonc, but this file was renamed to microfrontends-custom.jsonc. The test will fail when executed because the file no longer exists.

View Details
📝 Patch Details
diff --git a/examples/nextjs-app/marketing/tests/microfrontends.test.ts b/examples/nextjs-app/marketing/tests/microfrontends.test.ts
index e18a3a2..fa47352 100644
--- a/examples/nextjs-app/marketing/tests/microfrontends.test.ts
+++ b/examples/nextjs-app/marketing/tests/microfrontends.test.ts
@@ -5,7 +5,7 @@ import { validateRouting } from '@vercel/microfrontends/next/testing';
 describe('microfrontends', () => {
   test('routing', () => {
     expect(() =>
-      validateRouting('./microfrontends.jsonc', {
+      validateRouting('./microfrontends-custom.jsonc', {
         'nextjs-app-marketing': ['/', '/city/amsterdam', '/flagged/docs'],
         'nextjs-app-docs': [
           '/docs',
diff --git a/examples/nextjs-app/marketing/tests/middleware.test.ts b/examples/nextjs-app/marketing/tests/middleware.test.ts
index bf989cb..3ccf1eb 100644
--- a/examples/nextjs-app/marketing/tests/middleware.test.ts
+++ b/examples/nextjs-app/marketing/tests/middleware.test.ts
@@ -13,13 +13,13 @@ jest.mock('flags/next', () => ({
 describe('middleware', () => {
   test('matches microfrontends paths', () => {
     expect(() =>
-      validateMiddlewareConfig(config, './microfrontends.jsonc'),
+      validateMiddlewareConfig(config, './microfrontends-custom.jsonc'),
     ).not.toThrow();
   });
 
   test('rewrites for flagged paths', async () => {
     await expect(
-      validateMiddlewareOnFlaggedPaths('./microfrontends.jsonc', middleware),
+      validateMiddlewareOnFlaggedPaths('./microfrontends-custom.jsonc', middleware),
     ).resolves.not.toThrow();
   });
 });
diff --git a/examples/nextjs-app/marketing/tests/next-config.test.ts b/examples/nextjs-app/marketing/tests/next-config.test.ts
index 3799ac9..e479186 100644
--- a/examples/nextjs-app/marketing/tests/next-config.test.ts
+++ b/examples/nextjs-app/marketing/tests/next-config.test.ts
@@ -34,7 +34,7 @@ describe('next.config.ts', () => {
 
       it('next.config.js redirects and rewrites should not match any microfrontend path', async () => {
         const mfeConfig = loadMicrofrontendConfigForEdge(
-          './microfrontends.jsonc',
+          './microfrontends-custom.jsonc',
         );
         const allPaths = [...getAllMicrofrontendPaths(mfeConfig)];
         const errors = [];

Analysis

Test files reference non-existent microfrontends.jsonc file

What fails: Three test files in examples/nextjs-app/marketing/tests/ call loadMicrofrontendConfigForEdge() and validateRouting()/validateMiddlewareConfig() with hardcoded path './microfrontends.jsonc', but this file does not exist.

How to reproduce:

cd examples/nextjs-app/marketing
node -e "
  const { loadMicrofrontendConfigForEdge } = require('@vercel/microfrontends/next/testing');
  loadMicrofrontendConfigForEdge('./microfrontends.jsonc');
"

Result: Throws Error: ENOENT: no such file or directory, open './microfrontends.jsonc'

Expected: All test files should reference the actual configuration file './microfrontends-custom.jsonc' which exists in the directory. The configuration file was renamed from microfrontends.jsonc to microfrontends-custom.jsonc, but the test calls were not updated.

Affected files:

  • examples/nextjs-app/marketing/tests/next-config.test.ts (line 37)
  • examples/nextjs-app/marketing/tests/microfrontends.test.ts (line 8)
  • examples/nextjs-app/marketing/tests/middleware.test.ts (lines 16, 22)

Note: The VC_MICROFRONTENDS_CONFIG_FILE_NAME environment variable set in package.json is used for server-side config loading via next.config.ts, not for these test utility functions which directly read the file path provided as an argument.

@kitfoster
Copy link
Collaborator Author

Tests are failing as the change is not yet supported by turborepo

@socket-security
Copy link

socket-security bot commented Nov 3, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedturbo@​2.5.2-canary.0 ⏵ 2.6.0100 +110086 +298 +1100

View full report

@kitfoster kitfoster marked this pull request as ready for review November 3, 2025 12:13
@kitfoster kitfoster merged commit b4b1101 into main Nov 3, 2025
21 checks passed
@kitfoster kitfoster deleted the custom-microfrontends-json branch November 3, 2025 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants