Skip to content

Commit

Permalink
fix(babel): circular deps cause infinite loops (fixes #1202) (#1205)
Browse files Browse the repository at this point in the history
  • Loading branch information
Anber committed Feb 8, 2023
1 parent 917db44 commit 57c0dc4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/purple-meals-deliver.md
@@ -0,0 +1,5 @@
---
'@linaria/babel-preset': patch
---

Another fix for infinite loops. Fixes #1202
5 changes: 4 additions & 1 deletion packages/babel/src/transform-stages/1-prepare-for-eval.ts
Expand Up @@ -365,7 +365,10 @@ export default async function prepareForEval(
if (cached) {
if (isEqual(cached.only, mergedOnly)) {
log('stage-1', '%s is already processed', name);
imports = cached.imports;
if (!resolveStack.includes(nextItem.name)) {
imports = cached.imports;
}

result = cached.result;
} else {
log(
Expand Down

0 comments on commit 57c0dc4

Please sign in to comment.