Skip to content

Commit bb628d7

Browse files
committed
Update error
1 parent e18642a commit bb628d7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/tailwindcss/src/css-parser.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1193,7 +1193,7 @@ describe.each(['Unix', 'Windows'])('Line endings: %s', (lineEndings) => {
11931193
/* ^ Missing closing } */
11941194
`),
11951195
).toThrowErrorMatchingInlineSnapshot(
1196-
`[CssSyntaxError: input.css: 7:12: Missing closing } at .bar]`,
1196+
`[CssSyntaxError: input.css: 6:10: Missing closing } at .bar]`,
11971197
)
11981198
})
11991199

packages/tailwindcss/src/css-parser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -574,14 +574,14 @@ export function parse(input: string, opts?: ParseOptions) {
574574
if (parent.kind === 'rule') {
575575
throw new CssSyntaxError(
576576
`Missing closing } at ${parent.selector}`,
577-
source ? [source, bufferStart, bufferStart] : null,
577+
parent.src ? [parent.src[0], parent.src[1], parent.src[1]] : null,
578578
)
579579
}
580580

581581
if (parent.kind === 'at-rule') {
582582
throw new CssSyntaxError(
583583
`Missing closing } at ${parent.name} ${parent.params}`,
584-
source ? [source, bufferStart, bufferStart] : null,
584+
parent.src ? [parent.src[0], parent.src[1], parent.src[1]] : null,
585585
)
586586
}
587587
}

0 commit comments

Comments
 (0)