MCPcopy
hub / github.com/rollup/rollup / logCannotBundleConfigAsEsm

Function logCannotBundleConfigAsEsm

src/utils/logs.ts:551–562  ·  view source on GitHub ↗
(originalError: Error)

Source from the content-addressed store, hash-verified

549}
550
551export function logCannotBundleConfigAsEsm(originalError: Error): RollupLog {
552 return tweakStackMessage(
553 {
554 cause: originalError,
555 code: INVALID_CONFIG_MODULE_FORMAT,
556 message: `Rollup transpiled your configuration to an ES module even though it appears to contain CommonJS elements. To resolve this, you can pass the "--bundleConfigAsCjs" flag to Rollup or change your configuration to only contain valid ESM code.\n\nOriginal error: ${originalError.message}`,
557 stack: originalError.stack,
558 url: getRollupUrl(URL_BUNDLE_CONFIG_AS_CJS)
559 },
560 originalError.message
561 );
562}
563
564export function logCannotLoadConfigAsCjs(originalError: Error): RollupLog {
565 return tweakStackMessage(

Callers 1

getConfigFileExportFunction · 0.90

Calls 2

getRollupUrlFunction · 0.90
tweakStackMessageFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…