Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support require() within try-catch block #1252

Open
Iced-Sun opened this issue Apr 26, 2024 · 1 comment
Open

Support require() within try-catch block #1252

Iced-Sun opened this issue Apr 26, 2024 · 1 comment
Labels

Comments

@Iced-Sun
Copy link

Iced-Sun commented Apr 26, 2024

What problem does this feature solve?

promise-inflight has something like:

let Bluebird
try {
  Bluebird = require('bluebird')
} catch (_) {
  Bluebird = Promise
}

Currently, farm throws with [ Farm ] Error: Can not resolve 'bluebird' from ../../../node_modules/.pnpm/[email protected]/node_modules/promise-inflight/inflight.js..

It could be worked around by installing the 'bluebird' package, but it seems more natural if farm could handle such cases OOTB.

What does the proposed API look like?

Should OOTB when using promise-inflight.

@wre232114
Copy link
Member

I'll take a look, thanks for reporting issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants