Skip to content

Commit e931e63

Browse files
committed
fix: Don't cache block errors in the factory.
1 parent e59985c commit e931e63

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/@css-blocks/core/src/BlockParser/BlockFactory.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,13 @@ export class BlockFactory {
106106
}
107107

108108
getBlock(identifier: FileIdentifier): Promise<Block> {
109-
if (this.promises[identifier]) { return this.promises[identifier]; }
109+
if (this.promises[identifier]) {
110+
return this.promises[identifier].catch(() => {
111+
// If we got an error last time, try again.
112+
// Also this makes sure that the error object gives a correct import stack trace.
113+
return this._getBlockPromise(identifier);
114+
});
115+
}
110116
return this._getBlockPromise(identifier);
111117
}
112118

0 commit comments

Comments
 (0)