You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/@css-blocks/core/src/BlockParser/BlockFactory.ts
+12-9
Original file line number
Diff line number
Diff line change
@@ -220,15 +220,18 @@ export class BlockFactory {
220
220
block.setName(uniqueName);
221
221
}
222
222
223
-
// Ensure the GUID is unique.
224
-
constguidRegResult=this.registerGuid(block.guid);
225
-
if(!guidRegResult){
226
-
block.addError(
227
-
newCssBlockError("Block uses a GUID that has already been used! Check dependencies for conflicting GUIDs and/or increase the number of significant characters used to generate GUIDs.",{
228
-
filename: block.identifier,
229
-
},
230
-
),
231
-
);
223
+
// We only register guids from blocks that don't have errors because those will get re-parsed.
224
+
if(block.isValid()){
225
+
// Ensure the GUID is unique.
226
+
constguidRegResult=this.registerGuid(block.guid);
227
+
if(!guidRegResult){
228
+
block.addError(
229
+
newCssBlockError("Block uses a GUID that has already been used! Check dependencies for conflicting GUIDs and/or increase the number of significant characters used to generate GUIDs.",{
230
+
filename: block.identifier,
231
+
},
232
+
),
233
+
);
234
+
}
232
235
}
233
236
234
237
// if the block has any errors, surface them here unless we're in fault tolerant mode.
0 commit comments