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

Make polyfill version validation a warning #8579

Merged
merged 2 commits into from Oct 30, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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