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

Best Practice For Importing Another Bit Component to Avoid Ripple CI Failure #8793

Open
gtwilliams03 opened this issue Apr 16, 2024 · 7 comments

Comments

@gtwilliams03
Copy link

Description

Ripple CI fails when I import another of my Bit components when the underlying Bit component's version has been bumped.

Specifications

  • Bit version: 1.6.126
  • Node version: 21.4.0
  • npm / yarn version: yarn 4.1.1
  • Platform: MacOS

Context and additional information

I have a library in Bit in which several components are built on others. Lately I have been experiencing Ripple CI build failures when importing another of my Bit components:

import { timeZone } from '@severed-links/common.js'

const UserMenu = () => React component follows

I get Ripple CI build errors when I tag all of the updated components and bit export them:

No matching version found for @severed-links/[email protected]
This error happened while installing a direct dependency of /tmp/capsules-root/sign-capsules/2024-3-16/1j66qup/[email protected]
BitErrorWithRichMessage: No matching version found for @severed-links/[email protected]

But @severed-links/common.js does exist with that semver number:

image

I feel like I am doing something very dumb and I hesitated even raising the issue to bother you all, but I just can't figure out why I am getting these build errors simply trying to use another of my components.

@GiladShoham
Copy link
Member

can you run bit show <comp-id> and check if you see the common/js in your dependencies?
(you can also paste here the output)

@gtwilliams03
Copy link
Author

This is what I see (and the common.js component is there?

┌───────────────────┬───────────────────────────────────────────────────────────────────────┐
│ id                │ severed-links.common/[email protected]                                 │
├───────────────────┼───────────────────────────────────────────────────────────────────────┤
│ scope             │ severed-links.common                                                  │
├───────────────────┼───────────────────────────────────────────────────────────────────────┤
│ name              │ user-menu                                                             │
├───────────────────┼───────────────────────────────────────────────────────────────────────┤
│ env               │ severed-links.common/envs/[email protected]               │
├───────────────────┼───────────────────────────────────────────────────────────────────────┤
│ package name      │ @severed-links/common.user-menu                                       │
├───────────────────┼───────────────────────────────────────────────────────────────────────┤
│ deprecated        │ false                                                                 │
├───────────────────┼───────────────────────────────────────────────────────────────────────┤
│ main file         │ UserMenu.js                                                           │
├───────────────────┼───────────────────────────────────────────────────────────────────────┤
│ files             │ UserMenu.composition.js                                               │
│                   │ UserMenu.js                                                           │
│                   │ UserMenu.module.scss                                                  │
│                   │ UserMenuComposition.module.scss                                       │
├───────────────────┼───────────────────────────────────────────────────────────────────────┤
│ dev files         │ UserMenu.composition.js (teambit.compositions/compositions)           │
├───────────────────┼───────────────────────────────────────────────────────────────────────┤
│ aspects           │ severed-links.common/envs/[email protected]               │
│                   │ teambit.compilation/compiler                                          │
│                   │ teambit.component/dev-files                                           │
│                   │ teambit.compositions/compositions                                     │
│                   │ teambit.dependencies/dependency-resolver                              │
│                   │ teambit.docs/docs                                                     │
│                   │ teambit.envs/envs                                                     │
│                   │ teambit.harmony/application                                           │
│                   │ teambit.pipelines/builder                                             │
│                   │ teambit.pkg/pkg                                                       │
│                   │ teambit.preview/preview                                               │
│                   │ teambit.semantics/schema                                              │
├───────────────────┼───────────────────────────────────────────────────────────────────────┤
│ dependencies      │ @severed-links/[email protected] (component)           │
│                   │ @severed-links/[email protected] (component)           │
│                   │ @severed-links/[email protected] (component)           │
│                   │ @severed-links/[email protected] (component)           │
│                   │ @severed-links/[email protected] (component)           │
├───────────────────┼───────────────────────────────────────────────────────────────────────┤
│ dev dependencies  │ @severed-links/[email protected] (component) │
├───────────────────┼───────────────────────────────────────────────────────────────────────┤
│ peer dependencies │ lodash@^4.17.21---------- (package)                                   │
│                   │ react@^17.0.0 || ^18.0.0- (package)                                   │
│                   │ [email protected] (package)                                   │
└───────────────────┴───────────────────────────────────────────────────────────────────────┘

@gtwilliams03
Copy link
Author

gtwilliams03 commented May 2, 2024

I am still battling with this. Every time I end up bumping the version of my common.js bit package, the other components that rely on that get out of sync with their dependencies:

No matching version found for @severed-links/[email protected]
This error happened while installing a direct dependency of /tmp/capsules-root/sign-capsules/2024-4-2/1g2ledc/[email protected]
BitErrorWithRichMessage: No matching version found for @severed-links/[email protected]

And I get an error trying to update components in my apps:

% yarn add @severed-links/[email protected]
➤ YN0000: · Yarn 4.1.1
➤ YN0000: ┌ Resolution step
➤ YN0082: │ @severed-links/common.js@npm:0.0.38: No candidates found
➤ YN0000: └ Completed in 0s 331ms
➤ YN0000: · Failed with errors in 0s 346ms

@GiladShoham
Copy link
Member

Are you running install directly with yarn? or bit install with yarn configured?

@gtwilliams03
Copy link
Author

Bit install with yarn configured

@gtwilliams03
Copy link
Author

I am still having this issue and I thought I would provide some additional examples. The Ripple build seems to fail when one of my Bit components imports another. This seems to happen when I update the child component. Here is an example of a recent build failure that I experienced:

image

The error message I received in the failing component log was:

No matching version found for @severed-links/[email protected]
This error happened while installing a direct dependency of /tmp/capsules-root/sign-capsules/2024-6-12/1u39dnr/[email protected]

The UserMenu component built successfully in the image above (with version 0.0.67). In addition, I can see the version available in the menu for the component:

image

Any ideas as to what I am doing wrong? I am not getting any errors locally.

@gtwilliams03
Copy link
Author

Also, I am now running bit version 1.7.41, yarn 4.3.1 (still on node 21.4.0).

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

No branches or pull requests

2 participants