Skip to content

Commit 6812188

Browse files
committed
Fix error when rule doesn't have a parent
1 parent d435db1 commit 6812188

File tree

1 file changed

+1
-1
lines changed
  • packages/tailwindcss-language-service/src/util

1 file changed

+1
-1
lines changed

packages/tailwindcss-language-service/src/util/jit.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export function getRuleContext(state: State, rule: Rule, className: string): str
9090
let context: string[] = [replaceClassName(state, rule.selector, className, '__placeholder__')]
9191

9292
let p: Container = rule
93-
while (p.parent.type !== 'root') {
93+
while (p.parent && p.parent.type !== 'root') {
9494
p = p.parent
9595
if (p.type === 'atrule') {
9696
// @ts-ignore

0 commit comments

Comments
 (0)