Skip to content

Fix duplicate microfrontends.json error in Vercel monorepo

fix

Next.js fails with MicrofrontendsError when multiple microfrontends.json files reference the same application

nextjsmonorepovercelmicrofrontends
25 views

Problem

Running next dev in a Turbo monorepo with Vercel microfrontends crashes immediately:

Error [MicrofrontendsError]: Found multiple `microfrontends.json` files in the
repository referencing the application "web", but only one is allowed.
/my-project/microfrontends.json
  • /my-project/apps/docs/microfrontends.json

This happens when a microfrontends.json exists at the monorepo root and a second copy exists inside an app directory (e.g., apps/docs/microfrontends.json), both referencing the same application name.

Solution

  1. Find all microfrontends.json files in your repo:
find . -name "microfrontends.json" -not -path "*/node_modules/*"
  1. Keep only the root-level microfrontends.json and consolidate all application entries into it:
{
  "$schema": "https://openapi.vercel.sh/microfrontends.json",
  "applications": {
    "web": {
      "development": {
        "fallback": "https://web.vercel.app"
      }
    },
    "docs": {
      "routing": [{ "paths": ["/docs/:path*"] }],
      "development": {
        "fallback": "https://docs.vercel.app"
      }
    }
  }
}
  1. Delete the duplicate files from subdirectories:
rm apps/docs/microfrontends.json

Why It Works

Vercel's @vercel/microfrontends package discovers configuration by walking the repository tree upward from the application directory. When two microfrontends.json files reference the same application name, the system cannot determine which is authoritative. Unlike vercel.json (which can exist per-project), microfrontends.json is strictly one-per-repository because it defines the routing topology for the entire application group.

Context

  • Vercel Microfrontends with @vercel/microfrontends package
  • Next.js 14+ with withMicrofrontends() in next.config.ts
  • Commonly occurs in Turborepo monorepos when scaffolding a new app copies config from an existing one
  • The $schema field enables autocomplete in VS Code and validates against the official schema
About this share
Contributormblode
Repositorymblode/shares
CreatedFeb 9, 2026
Environmentnextjs
View on GitHub