Skip to content

Commit

Permalink
fix(babel): squash "cannot read properties of null" (fixes #1262) (#1271
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Anber committed Jul 4, 2023
1 parent 1085992 commit 890b4ac
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/cyan-books-push.md
@@ -0,0 +1,5 @@
---
'@linaria/utils': patch
---

Sometimes Babel doesn't mark removed nodes as removed. An additional check was added. Fixes #1262
2 changes: 1 addition & 1 deletion packages/esbuild/src/index.ts
Expand Up @@ -43,7 +43,7 @@ export default function linaria({

const result = await build.resolve(token, {
resolveDir: context,
kind: "import-statement"
kind: 'import-statement',
});

if (result.errors.length > 0) {
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/src/isRemoved.ts
Expand Up @@ -16,7 +16,7 @@ export default function isRemoved(path: NodePath): boolean {

if (parent) {
// If the parent path has been removed, return true
if (parent.removed) {
if (parent.removed || parent.node === null) {
return true;
}

Expand Down

0 comments on commit 890b4ac

Please sign in to comment.