Skip to content

Commit

Permalink
Fix crash
Browse files Browse the repository at this point in the history
  • Loading branch information
thecrypticace committed Sep 24, 2024
1 parent b1e25fd commit d4f80ab
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/resolve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,13 @@ export function maybeResolve(name: string) {
let modpath = resolveCache.get(name)

if (modpath === undefined) {
modpath = resolveJsFrom(fileURLToPath(import.meta.url), name)
resolveCache.set(name, modpath)
try {
modpath = resolveJsFrom(fileURLToPath(import.meta.url), name)
resolveCache.set(name, modpath)
} catch (err) {
resolveCache.set(name, null)
return null
}
}

return modpath
Expand Down

0 comments on commit d4f80ab

Please sign in to comment.