diff --git a/src/parsers/atrules.ts b/src/parsers/atrules.ts index 62e73cf5..fedb647f 100644 --- a/src/parsers/atrules.ts +++ b/src/parsers/atrules.ts @@ -122,7 +122,14 @@ export const parseKeyFrames = (css: Root): void => { return; } - const rootFlipped = postcss.parse(atRuleFlippedString); + /* the source could be undefined in certain cases but not during the tests */ + /* istanbul ignore next */ + const rootFlipped = postcss.parse( + atRuleFlippedString, + { + from: atRule.source?.input?.from + } + ); const atRuleFlipped = rootFlipped.first as AtRule; const atRuleParams = atRule.params; diff --git a/src/parsers/rules.ts b/src/parsers/rules.ts index 06ae11a8..6bf7705d 100644 --- a/src/parsers/rules.ts +++ b/src/parsers/rules.ts @@ -51,7 +51,14 @@ export const parseRules = ( controlDirective.option ) { const sourceDirectiveValue = getSourceDirectiveValue(controlDirectives); - const root = postcss.parse(controlDirective.option); + /* the source could be undefined in certain cases but not during the tests */ + /* istanbul ignore next */ + const root = postcss.parse( + controlDirective.option, + { + from: container.source?.input?.from + } + ); if (mode !== Mode.diff) { root.walkRules((rule: Rule): void => { addSelectorPrefixes(