Skip to content

Commit

Permalink
improve the error message when importing a component with the same id…
Browse files Browse the repository at this point in the history
… as a local one (#8698)
  • Loading branch information
davidfirst authored Mar 21, 2024
1 parent 55e3b32 commit 8a338be
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scopes/scope/importer/import-components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -618,9 +618,10 @@ to write the components from .bitmap file according to the their remote, please
ids.forEach((id: ComponentID) => {
const existingId = this.consumer.getParsedIdIfExist(id.toStringWithoutVersion());
if (existingId && !existingId.hasScope()) {
throw new BitError(`unable to import ${id.toString()}. the component name conflicted with your local component with the same name.
it's fine to have components with the same name as long as their scope names are different.
Make sure to export your component first to get a scope and then try importing again`);
throw new BitError(`unable to import ${id.toString()}. the component name conflicted with your local (new/staged) component with the same name.
it's fine to have components with the same name as long as their scope names are different.
if the component was created by mistake, remove it and import the remote one.
otherwise, if tagged/snapped, "bit reset" it, then bit rename it.`);
}
});
}
Expand Down

0 comments on commit 8a338be

Please sign in to comment.