MCPcopy
hub / github.com/rollup/rollup / logCannotLoadConfigAsEsm

Function logCannotLoadConfigAsEsm

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

Source from the content-addressed store, hash-verified

575}
576
577export function logCannotLoadConfigAsEsm(originalError: Error): RollupLog {
578 return tweakStackMessage(
579 {
580 cause: originalError,
581 code: INVALID_CONFIG_MODULE_FORMAT,
582 message: `Node tried to load your configuration as an ES module even though it is likely CommonJS. To resolve this, change the extension of your configuration to ".cjs" or pass the "--bundleConfigAsCjs" flag.\n\nOriginal error: ${originalError.message}`,
583 stack: originalError.stack,
584 url: getRollupUrl(URL_BUNDLE_CONFIG_AS_CJS)
585 },
586 originalError.message
587 );
588}
589
590export function logInvalidExportOptionValue(optionValue: string): RollupLog {
591 return {

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…