File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,7 +25,10 @@ export namespace Npm {
2525 }
2626
2727 function resolveEntryPoint ( name : string , dir : string ) {
28- const entrypoint = typeof Bun !== "undefined" ? import . meta. resolve ( name , dir ) : import . meta. resolve ( dir )
28+ let entrypoint : string | undefined
29+ try {
30+ entrypoint = typeof Bun !== "undefined" ? import . meta. resolve ( name , dir ) : import . meta. resolve ( dir )
31+ } catch { }
2932 const result = {
3033 directory : dir ,
3134 entrypoint,
Original file line number Diff line number Diff line change @@ -1365,7 +1365,9 @@ export namespace Provider {
13651365
13661366 let installedPath : string
13671367 if ( ! model . api . npm . startsWith ( "file://" ) ) {
1368- installedPath = await Npm . add ( model . api . npm ) . then ( ( item ) => item . entrypoint )
1368+ const item = await Npm . add ( model . api . npm )
1369+ if ( ! item . entrypoint ) throw new Error ( `Package ${ model . api . npm } has no import entrypoint` )
1370+ installedPath = item . entrypoint
13691371 } else {
13701372 log . info ( "loading local provider" , { pkg : model . api . npm } )
13711373 installedPath = model . api . npm
You can’t perform that action at this time.
0 commit comments