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

import "./package.js" is treated the same as "package" #377

Open
UtkarshVerma opened this issue May 27, 2023 · 3 comments
Open

import "./package.js" is treated the same as "package" #377

UtkarshVerma opened this issue May 27, 2023 · 3 comments

Comments

@UtkarshVerma
Copy link

UtkarshVerma commented May 27, 2023

I just ran into a rare edge case where madge is resolving ./package.js and package (from npm) to be the same. This gave me weird cyclic dependencies when there were actually none.

This is in the context of a Typescript codebase strictly using ES6 syntax.

@cpoliver-perenna
Copy link

cpoliver-perenna commented Jun 5, 2023

I'm having the same issue. I have a file src/mocks/msw.ts that is importing the node module msw (./node_modules/msw/lib/index) and is producing a false positive for a circular import.

If I rename the file to mswSetup.ts no circular dependencies are reported.

@fwuensche
Copy link

fwuensche commented Aug 7, 2023

Thanks for sharing and maintaining the library 🤗

Just wanted to report we've faced the same issue. We had a file named jimp.ts with the below:

import jimp from 'jimp'

Madge was pointing out as if we had a new circular dependency in the project.

image

After debugging, we've found this open issue and worked around it by renaming the file from jimp.ts to jimp-helper.ts

Maybe we can contribute to fixing the issue. It'd just be great to have a hint as to where to get started.

@adamsmasher
Copy link

Also hitting this (a file called styles/react-select.ts for styling our react-select components). Easy to work around, but annoying.

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

4 participants