MCPcopy
hub / github.com/rollup/rollup / logInconsistentImportAttributes

Function logInconsistentImportAttributes

src/utils/logs.ts:488–504  ·  view source on GitHub ↗
(
	existingAttributes: Record<string, string>,
	newAttributes: Record<string, string>,
	source: string,
	importer: string
)

Source from the content-addressed store, hash-verified

486}
487
488export function logInconsistentImportAttributes(
489 existingAttributes: Record<string, string>,
490 newAttributes: Record<string, string>,
491 source: string,
492 importer: string
493): RollupLog {
494 return {
495 code: INCONSISTENT_IMPORT_ATTRIBUTES,
496 message: `Module "${relativeId(importer)}" tried to import "${relativeId(
497 source
498 )}" with ${formatAttributes(
499 newAttributes
500 )} attributes, but it was already imported elsewhere with ${formatAttributes(
501 existingAttributes
502 )} attributes. Please ensure that import attributes for the same module are always consistent.`
503 };
504}
505
506const formatAttributes = (attributes: Record<string, string>): string => {
507 const entries = Object.entries(attributes);

Callers 4

fetchModuleMethod · 0.90
resolveDynamicImportMethod · 0.90
addSourceMethod · 0.90

Calls 2

relativeIdFunction · 0.85
formatAttributesFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…