@@ -517,13 +517,15 @@ export function getAllFields(
517517
518518 const fields : DataField [ ] = [ ] ;
519519 for ( const mixin of decl . mixins ) {
520- invariant ( mixin . ref , `Mixin ${ mixin . $refText } is not resolved` ) ;
521- fields . push ( ...getAllFields ( mixin . ref , includeIgnored , seen ) ) ;
520+ if ( mixin . ref ) {
521+ fields . push ( ...getAllFields ( mixin . ref , includeIgnored , seen ) ) ;
522+ }
522523 }
523524
524525 if ( isDataModel ( decl ) && decl . baseModel ) {
525- invariant ( decl . baseModel . ref , `Base model ${ decl . baseModel . $refText } is not resolved` ) ;
526- fields . push ( ...getAllFields ( decl . baseModel . ref , includeIgnored , seen ) ) ;
526+ if ( decl . baseModel . ref ) {
527+ fields . push ( ...getAllFields ( decl . baseModel . ref , includeIgnored , seen ) ) ;
528+ }
527529 }
528530
529531 fields . push ( ...decl . fields . filter ( ( f ) => includeIgnored || ! hasAttribute ( f , '@ignore' ) ) ) ;
@@ -541,13 +543,15 @@ export function getAllAttributes(
541543
542544 const attributes : DataModelAttribute [ ] = [ ] ;
543545 for ( const mixin of decl . mixins ) {
544- invariant ( mixin . ref , `Mixin ${ mixin . $refText } is not resolved` ) ;
545- attributes . push ( ...getAllAttributes ( mixin . ref , seen ) ) ;
546+ if ( mixin . ref ) {
547+ attributes . push ( ...getAllAttributes ( mixin . ref , seen ) ) ;
548+ }
546549 }
547550
548551 if ( isDataModel ( decl ) && decl . baseModel ) {
549- invariant ( decl . baseModel . ref , `Base model ${ decl . baseModel . $refText } is not resolved` ) ;
550- attributes . push ( ...getAllAttributes ( decl . baseModel . ref , seen ) ) ;
552+ if ( decl . baseModel . ref ) {
553+ attributes . push ( ...getAllAttributes ( decl . baseModel . ref , seen ) ) ;
554+ }
551555 }
552556
553557 attributes . push ( ...decl . attributes ) ;
0 commit comments