{"record":{"id":"1fc66b99701770b5","repo":"parcel-bundler/parcel","slug":"unsupported-output-format-b-env-outputformat","errorCode":null,"errorMessage":"Unsupported output format: ${b.env.outputFormat}","messagePattern":"Unsupported output format: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/runtimes/rsc/src/RSCRuntime.js","lineNumber":273,"sourceCode":"                  }\n                  bootstrapModules.push(url);\n                  Object.assign(importMap, getImportMap(bundleGraph, b));\n                }\n\n                if (b.env.context === bundle.env.context) {\n                  if (b.env.outputFormat === 'esmodule') {\n                    js.push(\n                      `parcelRequire.load(${JSON.stringify(b.publicId)})`,\n                    );\n                  } else if (b.env.outputFormat === 'commonjs') {\n                    let relativePath = JSON.stringify(\n                      relativeBundlePath(bundle, b),\n                    );\n                    js.push(\n                      `Promise.resolve(__parcel__require__(${relativePath}))`,\n                    );\n                  } else {\n                    throw new Error(\n                      'Unsupported output format: ' + b.env.outputFormat,\n                    );\n                  }\n                }\n\n                // Find the client entry in this bundle group if any.\n                if (bundle.env.isServer() && b.env.isBrowser() && !entry) {\n                  b.traverseAssets((a, ctx, actions) => {\n                    if (\n                      Array.isArray(a.meta.directives) &&\n                      a.meta.directives.includes('use client-entry')\n                    ) {\n                      entry = a;\n                      actions.stop();\n                    }\n                  });\n                }\n              }","sourceCodeStart":255,"sourceCodeEnd":291,"githubUrl":"https://github.com/parcel-bundler/parcel/blob/59484858a1a0bcbb71f74088956bb437a2db6505/packages/runtimes/rsc/src/RSCRuntime.js#L255-L291","documentation":"Thrown by @parcel/runtime-rsc when generating the runtime glue for a bundle group whose sibling bundle has an outputFormat other than 'esmodule' or 'commonjs'. The RSC runtime emits either `parcelRequire.load(...)` (ESM) or `__parcel__require__(...)` (CJS); any other format ('global'/'iife'/undefined) has no codegen path. The check is per sibling bundle in the same context as the parent.","triggerScenarios":"An RSC build where a bundle reached the runtime-rsc codegen step with outputFormat === 'global' (the third common Parcel format) or undefined. Typical when scope hoisting is off or a target forces global/IIFE output for a sub-bundle that ends up referenced from an RSC bundle group.","commonSituations":"Setting the target outputFormat to 'global' (or leaving default in non-scope-hoist mode) for a React Server Components build; mixing an ESM/CJS RSC bundle with a sibling bundle built for a UMD/global context; library mode misconfigured for RSC.","solutions":["Use scope hoisting (default in production) so RSC bundles emit ESM/CJS rather than global.","Set the relevant target's outputFormat to 'esmodule' or 'commonjs' in .parcelrc or package.json targets.","Avoid library/isLibrary mode for RSC bundles unless you explicitly control outputFormat.","Audit .parcelrc and targets to ensure no transformer/runtime forces 'global' on RSC sub-bundles."],"exampleFix":"// before: package.json targets\n\"targets\": {\n  \"main\": { \"context\": \"react-server\", \"outputFormat\": \"global\" }\n}\n// after\n\"targets\": {\n  \"main\": { \"context\": \"react-server\", \"outputFormat\": \"esmodule\", \"scopeHoist\": true }\n}","handlingStrategy":"validation","validationCode":"// Validate RSC target outputFormat before building\nconst ALLOWED = new Set(['esmodule', 'commonjs']);\nfunction validateRSCTargets(targets) {\n  for (const [name, t] of Object.entries(targets)) {\n    if (t.context === 'react-server' && !ALLOWED.has(t.outputFormat)) {\n      throw new Error(`target ${name}: react-server outputFormat must be esmodule or commonjs (got ${t.outputFormat})`);\n    }\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always enable scopeHoist for RSC builds.","Keep RSC targets in their own config object so outputFormat is never accidentally set to 'global'."],"tags":["rsc","output-format","bundle-config","scope-hoist"],"backgroundTag":null,"analyzedSha":"59484858a1a0bcbb71f74088956bb437a2db6505","analyzedAt":"2026-08-13T04:06:35.925Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}