Skip to content

Commit

Permalink
Make polyfill version validation a warning (#8579)
Browse files Browse the repository at this point in the history
  • Loading branch information
mischnic committed Oct 30, 2022
1 parent 05d0bc0 commit 0759d1b
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions packages/utils/node-resolver-core/src/NodeResolver.js
Expand Up @@ -27,9 +27,10 @@ import {
isGlobMatch,
} from '@parcel/utils';
import ThrowableDiagnostic, {
encodeJSONKeyComponent,
errorToDiagnostic,
generateJSONCodeHighlights,
md,
encodeJSONKeyComponent,
} from '@parcel/diagnostic';
import builtins, {empty} from './builtins';
import nullthrows from 'nullthrows';
Expand Down Expand Up @@ -377,18 +378,21 @@ export default class NodeResolver {
}
} else if (builtin.range != null) {
// Assert correct version

// TODO packageManager can be null for backwards compatibility, but that could cause invalid
// resolutions in monorepos
await packageManager?.resolve(
packageName,
this.projectRoot + '/index',
{
saveDev: true,
shouldAutoInstall: this.shouldAutoInstall,
range: builtin.range,
},
);
try {
// TODO packageManager can be null for backwards compatibility, but that could cause invalid
// resolutions in monorepos
await packageManager?.resolve(
packageName,
this.projectRoot + '/index',
{
saveDev: true,
shouldAutoInstall: this.shouldAutoInstall,
range: builtin.range,
},
);
} catch (e) {
this.logger?.warn(errorToDiagnostic(e));
}
}
}

Expand Down

0 comments on commit 0759d1b

Please sign in to comment.