Skip to content

Commit 294f0be

Browse files
author
Timothy Lindvall
committed
fix: Use debug idents for errors in BlockFactory.
1 parent 8118d49 commit 294f0be

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/@css-blocks/core/src/BlockParser/BlockFactory.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -339,24 +339,24 @@ export class BlockFactory {
339339
// NOTE: No need to run preprocessor - we assume that Compiled CSS has already been preprocessed.
340340
// Parse the definition file into an AST
341341
const definitionAst = this.postcssImpl.parse(file.definitionContents);
342-
const definitionFilepath = this.importer.filesystemPath(file.definitionIdentifier, this.configuration) || "<unknown filepath>";
342+
const dfnDebugIdentifier = this.importer.debugIdentifier(file.definitionIdentifier, this.configuration);
343343

344344
// Parse the CSS contents into an AST
345345
const cssContentsAst = this.postcssImpl.parse(file.cssContents);
346-
const cssContentsFilepath = this.importer.filesystemPath(file.identifier, this.configuration) || "<unknown filepath>";
346+
const cssDebugIdentifier = this.importer.debugIdentifier(file.identifier, this.configuration);
347347

348348
// TODO: Sourcemaps?
349349

350350
// Sanity check! Did we actually get contents for both ASTs?
351351
if (!definitionAst || !definitionAst.nodes) {
352352
throw new CssBlockError(`Unable to parse definition file into AST!`, {
353-
filename: definitionFilepath,
353+
filename: dfnDebugIdentifier,
354354
});
355355
}
356356

357357
if (!cssContentsAst || !cssContentsAst.nodes) {
358358
throw new CssBlockError(`Unable to parse CSS contents into AST!`, {
359-
filename: cssContentsFilepath,
359+
filename: cssDebugIdentifier,
360360
});
361361
}
362362

0 commit comments

Comments
 (0)