File tree 1 file changed +12
-1
lines changed
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -116,7 +116,7 @@ export class CatalogEntry extends CardDef {
116
116
private loadCardIcon = restartableTask (async () => {
117
117
if (this .args .model .ref && this .args .model .id ) {
118
118
let card = await loadCard (this .args .model .ref , {
119
- loader: ( import . meta as any ). loader ,
119
+ loader: myLoader () ,
120
120
relativeTo: new URL (this .args .model .id ),
121
121
});
122
122
this .icon = card .icon ;
@@ -399,3 +399,14 @@ function getIcon(specType: string) {
399
399
return ;
400
400
}
401
401
}
402
+
403
+ function myLoader(): Loader {
404
+ // we know this code is always loaded by an instance of our Loader, which sets
405
+ // import.meta.loader.
406
+
407
+ // When type-checking realm-server, tsc sees this file and thinks
408
+ // it will be transpiled to CommonJS and so it complains about this line. But
409
+ // this file is always loaded through our loader and always has access to import.meta.
410
+ // @ts-ignore
411
+ return (import .meta as any ).loader ;
412
+ }
You can’t perform that action at this time.
0 commit comments