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

Component Not Found: Bit not exporting components correctly #2171

Closed
AlexanderKaran opened this issue Dec 4, 2019 · 10 comments · Fixed by #2174
Closed

Component Not Found: Bit not exporting components correctly #2171

AlexanderKaran opened this issue Dec 4, 2019 · 10 comments · Fixed by #2174

Comments

@AlexanderKaran
Copy link

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.

Specifications

  • Bit version: 14.6.0
  • Node version: 13.2.0
  • npm / yarn version: 6.13.1
  • Platform: MacOS
  • Bit compiler (include version): [email protected]
  • Bit tester (include version):
@AlexanderKaran
Copy link
Author

AlexanderKaran commented Dec 4, 2019

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

@GiladShoham
Copy link
Member

@AlexanderKaran Thanks for reporting this.
I'm looking into it, I'll post my findings here.

@GiladShoham GiladShoham added this to the 14.6.0 milestone Dec 4, 2019
@davidfirst davidfirst self-assigned this Dec 4, 2019
davidfirst added a commit that referenced this issue Dec 4, 2019
…pes and there are dependencies between them
davidfirst added a commit that referenced this issue Dec 5, 2019
…pes and there are dependencies between them (#2174)
@davidfirst
Copy link
Member

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.

@AlexanderKaran
Copy link
Author

AlexanderKaran commented Dec 10, 2019

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.

@GiladShoham GiladShoham reopened this Dec 10, 2019
@davidfirst
Copy link
Member

@AlexanderKaran , I'd like to try to reproduce it.
I'll need two things, please.

  1. the error you got. It includes the component-name that was not found.
  2. run "bit graph" and send me the picture you got. It'll help me understand the relationship between the components. (you can send to my email [email protected]).

@AlexanderKaran
Copy link
Author

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.

@davidfirst
Copy link
Member

No worries, please re-open once you're able to reproduce it.

@KutnerUri
Copy link
Contributor

Happening to me right now.
Screen Shot 2020-03-17 at 17 30 53

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?

@KutnerUri
Copy link
Contributor

ok, exporting with the --all-versions solves this!

davidfirst added a commit that referenced this issue Mar 17, 2020
…rt with no args and a flattened dependency was converted from no-scope to a remote-scope
davidfirst added a commit that referenced this issue Mar 18, 2020
…rt with no args and a flattened dependency was converted from no-scope to a remote-scope (#2466)
@davidfirst
Copy link
Member

Fixed by the commit above and merged into master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants