File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed
client/packages/lowcoder/src/comps/comps/remoteComp Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -7,12 +7,23 @@ async function npmLoader(remoteInfo: RemoteCompInfo): Promise<CompConstructor |
77 // log.info("load npm plugin:", remoteInfo);
88 const { packageName, packageVersion = "latest" , compName } = remoteInfo ;
99 const entry = `${ NPM_PLUGIN_ASSETS_BASE_URL } /${ packageName } @${ packageVersion } /index.js` ;
10- const module = await import ( /* webpackIgnore: true */ entry ) ;
11- const comp = module . default ?. [ compName ] ;
12- if ( ! comp ) {
10+ console . log ( "Entry" , entry ) ;
11+ try {
12+ const module = await import ( /* webpackIgnore: true */ entry ) ;
13+ // let module = moduleGlobe;
14+ // if (packageName !== "openblocks-comps-workmeet") {
15+ // module = await import(entry);
16+ // }
17+ console . log ( "Entry 1" , module ) ;
18+ const comp = module . default ?. [ compName ] ;
19+ if ( ! comp ) {
20+ throw new Error ( trans ( "npm.compNotFound" , { compName } ) ) ;
21+ }
22+ return comp ;
23+ } catch ( e ) {
24+ console . log ( "eeeee" , e ) ;
1325 throw new Error ( trans ( "npm.compNotFound" , { compName } ) ) ;
1426 }
15- return comp ;
1627}
1728
1829async function bundleLoader ( remoteInfo : RemoteCompInfo ) : Promise < CompConstructor | null > {
You can’t perform that action at this time.
0 commit comments