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

Failed to tag a component after untagging component versions using --scope flag #1817

Closed
ranm8 opened this issue Jul 11, 2019 · 4 comments · Fixed by #1820
Closed

Failed to tag a component after untagging component versions using --scope flag #1817

ranm8 opened this issue Jul 11, 2019 · 4 comments · Fixed by #1820

Comments

@ranm8
Copy link
Member

ranm8 commented Jul 11, 2019

Describe the bug

Bit fails to tag a component by trying to resolve non-existing version of another component with the following error:

error: bit failed to build ranm8.ngx-bootstrap/alert@5.1.0 with the following exception:
error: component “ranm8.ngx-bootstrap/internal/utils@5.1.1” was not found
ComponentNotFound
   at /Users/ranmizrahi/Bit/bit/dist/scope/scope.js:853:13
   at Generator.next (<anonymous>)
   at Generator.tryCatcher (/Users/ranmizrahi/Bit/bit/node_modules/bluebird/js/release/util.js:16:23)
   at PromiseSpawn._promiseFulfilled (/Users/ranmizrahi/Bit/bit/node_modules/bluebird/js/release/generators.js:97:49)
   at Promise._settlePromise (/Users/ranmizrahi/Bit/bit/node_modules/bluebird/js/release/promise.js:574:26)
   at Promise._settlePromise0 (/Users/ranmizrahi/Bit/bit/node_modules/bluebird/js/release/promise.js:614:10)
   at Promise._settlePromises (/Users/ranmizrahi/Bit/bit/node_modules/bluebird/js/release/promise.js:694:18)
   at _drainQueueStep (/Users/ranmizrahi/Bit/bit/node_modules/bluebird/js/release/async.js:138:12)
   at _drainQueue (/Users/ranmizrahi/Bit/bit/node_modules/bluebird/js/release/async.js:131:9)
   at Async._drainQueues (/Users/ranmizrahi/Bit/bit/node_modules/bluebird/js/release/async.js:147:5)
   at Immediate.Async.drainQueues [as _onImmediate] (/Users/ranmizrahi/Bit/bit/node_modules/bluebird/js/release/async.js:17:14)
   at runCallback (timers.js:705:18)
   at tryOnImmediate (timers.js:676:5)
   at processImmediate (timers.js:658:5)

Steps to Reproduce

  1. tagged three components (A, B and C) in version 5.1.0 on one workspace (while A depends on B).
  2. exported all components to a remote collection on bit.dev.
  3. tagged all of the components again using bit tag -s 5.1.1.
  4. untagged all of the components using bit untag -a
  5. changed component A which depends on B and tagged this modified component using bit tag -a 5.1.1.
  6. got the above error

Expected Behavior

Expected component A to be tagged in version 5.1.1.

Specifications

  • Bit version: 14.1.4-dev.10
  • Node version: v10.16.0
  • npm version: 6.9.0
  • Platform: MacOS 10.14.5
  • Bit compiler (include version): ng-packgr@0.0.19
  • Bit tester (include version): N/A
@ranm8 ranm8 added the type/bug label Jul 11, 2019
@ranm8 ranm8 assigned ranm8 and davidfirst and unassigned ranm8 Jul 11, 2019
@ranm8 ranm8 added this to the Capsule milestone Jul 11, 2019
davidfirst added a commit that referenced this issue Jul 11, 2019
…then it won't throw ComponentNotFound when tagging after export & tag & untag
@davidfirst
Copy link
Member

The reason for the error is that upon tagging 5.1.1, the package.json has updated the version prop with 5.1.1. However, upon untag Bit didn't update the file. So then, when building A, it looked for B with version 5.1.1, which doesn't exist.

The root cause of this issue is the fact that Bit had two different processes of updating the version in .bitmap and package.json, one for tag and one for untag. With the commit above, this had been unified into one process.

davidfirst added a commit that referenced this issue Jul 12, 2019
* fix #1817, update component's package.json of authored upon untag so then it won't throw ComponentNotFound when tagging after export & tag & untag

* add an e2e-test
@ranm8
Copy link
Member Author

ranm8 commented Jul 15, 2019

@davidfirst this issue still persists. Reopening...

@ranm8 ranm8 reopened this Jul 15, 2019
@davidfirst
Copy link
Member

@ranm8 , I am unable to reproduce it. There is a good chance that you keep having this issue because you didn't delete the old node_modules/@bit directory, which contained package.json with different versions.

Here is what I did

// reset-to-add (changed the .bitmap to be like all is new, removed .bit/objects etc)
// Removed node_modules/@bit => this is the most critical part. If you don't do it, you'll get the same issue!
bit tag -a
bit export remote-scope
bit tag -s 5.1.1
bit untag -a
// changed accordion.
bit tag -a // success!
// changed alert
bit tag -a  // success!

@davidfirst
Copy link
Member

@ranm8 , please re-open if you think it's still an issue.

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.

2 participants