madge
madge copied to clipboard
import "./package.js" is treated the same as "package"
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.
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.
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.
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.
Also hitting this (a file called styles/react-select.ts
for styling our react-select
components). Easy to work around, but annoying.