Unverified Commit a89e6513 authored by Maia Teegarden's avatar Maia Teegarden Committed by GitHub

Keep attempting to load binary files after failure (#30755)

Multiple binaries may be installed when only one of them will work with
the host machine (limitation of `optionalDependencies`). Failing to
`require` a binary that exists does not necessarily mean there is a
problem with the binary. We need to keep checking if other binaries work.

Fixes #30713



## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
parent 4ac02274
...@@ -32,7 +32,6 @@ for (const triple of triples) { ...@@ -32,7 +32,6 @@ for (const triple of triples) {
} catch (e) { } catch (e) {
if (e?.code !== 'MODULE_NOT_FOUND') { if (e?.code !== 'MODULE_NOT_FOUND') {
loadError = e loadError = e
break
} }
} }
} }
...@@ -46,6 +45,8 @@ if (!bindings) { ...@@ -46,6 +45,8 @@ if (!bindings) {
`Failed to load SWC binary, see more info here: https://nextjs.org/docs/messages/failed-loading-swc` `Failed to load SWC binary, see more info here: https://nextjs.org/docs/messages/failed-loading-swc`
) )
process.exit(1) process.exit(1)
} else {
loadError = null
} }
async function transform(src, options) { async function transform(src, options) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment