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

[BUG] Circular Dependency between comparator.js and range.js #318

Closed
silverwind opened this issue Mar 7, 2020 · 5 comments
Closed

[BUG] Circular Dependency between comparator.js and range.js #318

silverwind opened this issue Mar 7, 2020 · 5 comments

Comments

@silverwind
Copy link

silverwind commented Mar 7, 2020

There is a circular dependency in semver which rollup will warn about when bundling the module:

classes\comparator.js -> classes\range.js -> classes\comparator.js

Even thought this may work because of Node's resolution mechanism, I'd recommended to refactor.

@isaacs
Copy link
Contributor

isaacs commented Apr 19, 2020

We could maybe do this by putting the intersects method in a different file.

@isaacs
Copy link
Contributor

isaacs commented Apr 19, 2020

Oh, actually, that's not possible, because anyone doing require('semver/classes/comparator') will get a broken class.

I think this is a legitimate case of two classes that have to reference one another, and the refactor will be rather strained. Is there a way to just tell rollup to be ok with it?

@isaacs isaacs closed this as completed Apr 19, 2020
@gp3gp3gp3
Copy link

This throws warnings in react native projects with the metro bundler which can't be silenced unless you silence all warnings unfortunately

@maietta
Copy link

maietta commented Feb 12, 2023

Yeah, I'm still having this problem in 2023...

@ilbrando
Copy link

ilbrando commented Jun 5, 2024

I'm also having this issue when using rollup to build my package which uses some other packages with a dependency to semver. The semver version used is 7.6.2 (currently the latest). Is there a workaround for this bug?

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

No branches or pull requests

5 participants