Skip to content

Commit d85e257

Browse files
committed
fix(typescript-transform): debugerror
1 parent 247529d commit d85e257

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/grumpy-bats-travel.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
"typescript-transform-lit-css": patch
3+
---
4+
Prevent `Error: Debug Failure. Did not expect SourceFile to have an Identifier in its trivia`. See [Typescript#39854](https://github.com/microsoft/TypeScript/issues/39854#issuecomment-732494514).

packages/typescript-transform-lit-css/typescript-transform-lit-css.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,8 @@ export default function(
236236
}
237237

238238
return (sourceFile: SourceFile) => {
239-
const children = sourceFile.getChildren();
239+
const children: ts.Node[] = [];
240+
sourceFile.forEachChild(node => children.push(node));
240241

241242
const decl = (children.find(x =>
242243
!ts.isTypeOnlyImportOrExportDeclaration(x) &&

0 commit comments

Comments
 (0)