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

Infinite recursion with file and directory sharing name (?) #359

Closed
Jym77 opened this issue Nov 22, 2023 · 5 comments
Closed

Infinite recursion with file and directory sharing name (?) #359

Jym77 opened this issue Nov 22, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@Jym77
Copy link

Jym77 commented Nov 22, 2023

OK, so I run in an infinite recursion problem (or at least too many recursion) while running knip. Not sure excatly what is the problem and how to investigate it, and wasn't able to make a MNWE 😖

I do suspect that there might be a problem with both src/selector.ts and src/selector/index.ts existing, which means that when src/selector/compound.ts tries to import { Absolute } from "./selector", it may mess up which file to use 🤔
The other possible culprit is that the types are effectively mutually recursive. That is essentially an algebraic list-like type, but split over several files and with some shenanigans. Maybe that is throwing knip out…

Anyway, any idea on how I could investigate further and figure out whether the problem is in my code or in knip?

@Jym77 Jym77 added the bug Something isn't working label Nov 22, 2023
@Jym77
Copy link
Author

Jym77 commented Nov 22, 2023

I do suspect that there might be a problem with both src/selector.ts and src/selector/index.ts existing, which means that when src/selector/compound.ts tries to import { Absolute } from "./selector", it may mess up which file to use 🤔

I'm further convinced that this is the reason. I've removed that double naming and knip succeed:

@webpro
Copy link
Collaborator

webpro commented Nov 28, 2023

Any chance you could setup a minimal case so I can reproduce it?

I've added two templates to the docs: http://localhost:4321/guides/troubleshooting/#minimal-reproduction

@Jym77
Copy link
Author

Jym77 commented Nov 28, 2023

I've added two templates to the docs: http://localhost:4321/guides/troubleshooting/#minimal-reproduction

URL is pointing to localhost 🙈

(I'll see what I can do with MNWE, but not sure I can find a lot of time for that, especially since I did manage to circumvent the problem…)

@webpro
Copy link
Collaborator

webpro commented Nov 28, 2023

LOL, it's here: https://knip.dev/guides/troubleshooting/#minimal-reproduction

Would be nice maybe for other Knip users, otherwise feel free to close this.

@Jym77
Copy link
Author

Jym77 commented Nov 28, 2023

That one feels too brittle for a MNWE 😖
I tried extracting the directory who breaks, it broke. But then making a small change and undoing it un-broke it 🤔
I'll just close this issue and keep a mental note in case I witness it again…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants