Skip to content

Commit

Permalink
await so the try/catch works!
Browse files Browse the repository at this point in the history
  • Loading branch information
timfish committed Jun 18, 2024
1 parent 167cb52 commit f2bbb22
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/get-exports.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ async function getExports (url, context, parentLoad) {
}

if (format === 'commonjs') {
return getCjsExports(url, context, parentLoad, source)
return await getCjsExports(url, context, parentLoad, source)
}

// At this point our `format` is either undefined or not known by us. Fall
Expand All @@ -109,7 +109,7 @@ async function getExports (url, context, parentLoad) {
// isn't set at first and yet we have an ESM module with no exports.
// I couldn't construct an example that would do this, so maybe it's
// impossible?
return getCjsExports(url, context, parentLoad, source)
return await getCjsExports(url, context, parentLoad, source)
}
} catch (cause) {
const err = new Error(`Failed to parse '${url}'`)
Expand Down

0 comments on commit f2bbb22

Please sign in to comment.