-
Notifications
You must be signed in to change notification settings - Fork 318
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
Non JS index files are skipped #128
Comments
Hey @OliverJAsh! Thanks for filing the issue. The mixed extension case isn't supported at the moment. The extension of the dependent module (.js) dictates the type of dependency sniffing and partial resolution. If you changed app.js to app.ts, does madge work fine? |
@mrjoelkemp Thanks for the fast response! It seems not:
|
It might be worth tracking this under a different issue. It would be great to support this—TS doesn't mind if you mix JS and TS imports. |
@OliverJAsh mind pasting in the debug info? It might require running madge with a debug option; the readme should have specifics. Feel free to create a new issue for mixed extension support. |
@mrjoelkemp How does this look?
|
Thanks for that. Would you mind double checking that helpers.ts exists in the same folder as app.ts? Just want to rule out some of the easy stuff. If helpers.ts does exist, then there's an issue with the typescript resolver in filing-cabinet. I must be missing some configuration for the typescript compiler: https://github.com/dependents/node-filing-cabinet/blob/master/index.js#L148. If you had time, a PR with a failing test case against the filing-cabinet repo would be incredibly helpful. I don't have a lot of time for open source these days, so any help is appreciated. |
The helpers module exists at
Does this change your diagnosis at all? If not, I will go ahead and investigate the issue against filing-cabinet. |
Have same issue. |
Why is this closed? I know that this is a bug in Specially critical case if someone is relying in Madge as circular dependency detector as part of their CI, and Madge let this pass silently. |
@marcos-diaz you can pass the --ts-config argument to solve the issue. |
I have the same issue. The imported |
I managed to make it work with In my case, with the structure
The working command is:
|
thanks @adjerbetian !! I'm using packages and you just saved me hours of debugging. I confirm that extends is not working using madge@ Guys you should consider adding this information to the Readme FAQ |
THANK YOU SOO MUCH. I've been working in the dark since we have a lot of aliases defined in the tsconfig. This addition solved it and now I see the circular dependencies that I knew existed. And now I can see what solves them. Just want to share my appreciation for this comment that helped me. Thank you! 🙏 |
I mentioned this on #322, but I wanted to share here as well in case it helps someone else. I ran into this issue where imports in TypeScript files that use an index file were not detected on madge version |
I'm still having this problem with version Not a single I've explicitly pointed to the tsconfig (both using Currently invoking: With the following {
"fileExtensions": [
"ts",
"tsx"
],
"excludeRegExp": [
".*styled-system/.*"
]
} |
@gabriellet & @markkorput, we have been facing the same problems. We did a short investigation, and it looks like the problem is much easier to solve. Check this out: |
Confirm this.. the same . does not work if only I set direct import right to index.ts |
Given:
When I run:
I get:
This seems to be because the index file has a
.ts
extension instead of.js
, however I believe this should be supported.What do you think?
The text was updated successfully, but these errors were encountered: