When running
bit export
After running
bit tag -all
Now and then Bit throws an error saying one component can not be found. The error looks like this:
error: component "[organisation].[collection]/[name]@[version]"
Now this happens completely randomly but it always seems to happen to the component that has no dependencies itself but other components are dependent on it. Generally, after making changes to a few components running tag all and export everything is fine; however, it seems that now and then Bit messes up and doesn't export the components in the correct order. What I mean is that it tries to export a component that is reliant on another component that was version bumped when normally Bit figures out what order to export them in.
After talking to Bit support it seems there is a bug in Bit, as Bit should be able to create the right order to export components. It seems that there's are some edge case that causes it to break.
For anyone who has the issue current workaround is to run the following command:
bit export [organisation].[collection] [name-of-component-thats-throwing-the-error]@[the-version-it-cant-find-in-the-error]
Then you can run
bit export
To export all other components
@AlexanderKaran Thanks for reporting this.
I'm looking into it, I'll post my findings here.
Thanks @AlexanderKaran for posting the issue.
It has been fixed in the PR above. You can see the PR to get the details why it happened.
Once this is released, if there are not any cyclic dependencies between the different scopes, Bit will export the dependencies first then the dependents to avoid the error you got.
Hey @davidfirst
I think this issue might not be 100% fixed.
I have come across the same issue again when working with components from different collections the difference this time being my workaround no longer works either.
@AlexanderKaran , I'd like to try to reproduce it.
I'll need two things, please.
Hi David
Sorry for the late reply, been out of the office.
I think the team removed the component and few others then re-added it to get around the issue so I can not run bit graph.
If it happens again I will forward on the details you requested.
Once again sorry for the slow reply.
No worries, please re-open once you're able to reproduce it.
Happening to me right now.

I can see the component is correctly tagged at the .bitmap:
"concrete/[email protected]": {
"files": [
{
"relativePath": "src/components/concrete/testimonial/index.ts",
"test": false,
"name": "index.ts"
},
{
"relativePath": "src/components/concrete/testimonial/testimonial-obj.tsx",
"test": false,
"name": "testimonial-obj.tsx"
},
{
"relativePath": "src/components/concrete/testimonial/testimonial.module.scss",
"test": false,
"name": "testimonial.module.scss"
},
{
"relativePath": "src/components/concrete/testimonial/testimonial.tsx",
"test": false,
"name": "testimonial.tsx"
}
],
"mainFile": "src/components/concrete/testimonial/index.ts",
"trackDir": "src/components/concrete/testimonial",
"origin": "AUTHORED",
"exported": false
},
What can I do?
ok, exporting with the --all-versions solves this!
Fixed by the commit above and merged into master.
Most helpful comment
ok, exporting with the
--all-versionssolves this!