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

fix(switch/checkout) - hide envs not loaded warnings during switch lanes / checkout #9128

Merged
merged 2 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions scopes/component/checkout/checkout.main.runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export class CheckoutMain {
) {}

async checkout(checkoutProps: CheckoutProps): Promise<ApplyVersionResults> {
this.workspace.inInstallContext = true;
const consumer = this.workspace.consumer;
const { version, ids, promptMergeOptions } = checkoutProps;
await this.syncNewComponents(checkoutProps);
Expand Down
5 changes: 3 additions & 2 deletions scopes/harmony/aspect-loader/aspect-loader.main.runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -769,9 +769,10 @@ export class AspectLoaderMain {
// TODO: improve texts
const errorMsg = e.message.split('\n')[0];
const warning = UNABLE_TO_LOAD_EXTENSION_FROM_LIST(ids, errorMsg, neededFor);
this.logger.error(warning, e);
if (mergedOptions.ignoreErrors) return;
if (e.code === 'MODULE_NOT_FOUND' && mergedOptions.hideMissingModuleError) return;
if ((e.code === 'MODULE_NOT_FOUND' || e.code === 'ERR_MODULE_NOT_FOUND') && mergedOptions.hideMissingModuleError)
return;
this.logger.error(warning, e);
if (mergedOptions.unifyErrorsByExtId) {
const needToPrint = some(ids, (id) => !this.failedToLoadExt.has(id));
if (!needToPrint) return;
Expand Down
1 change: 1 addition & 0 deletions scopes/lanes/lanes/lanes.main.runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,7 @@ please create a new lane instead, which will include all components of this lane
if (!this.workspace) {
throw new BitError(`unable to switch lanes outside of Bit workspace`);
}
this.workspace.inInstallContext = true;
let mergeStrategy;
if (merge && typeof merge === 'string') {
const mergeOptions = Object.keys(MergeOptions);
Expand Down