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

Paths with special characters are not properly handled #347

Closed
tee-yankov opened this issue Aug 9, 2024 · 6 comments · Fixed by #349
Closed

Paths with special characters are not properly handled #347

tee-yankov opened this issue Aug 9, 2024 · 6 comments · Fixed by #349
Labels
bug Something isn't working

Comments

@tee-yankov
Copy link

tee-yankov commented Aug 9, 2024

Hi there! Thank you for maintaining this library. My colleagues and I recently stumbled onto a bug that left us scratching our heads for a while, until we figured out the specific reason our build process was failing for only one person on the team.

We concluded that resolve-tspaths just doesn't handle paths with special characters well.

To reproduce this, have a path such as:

/home/user/Projects/MyProject (MP)/tsconfig.json

Then running resolve-tspaths --verbose in that directory. This will result in resolve-tspaths detecting no files to process, even though there are such files. We saw that filesToProcess from the --verbose output was just empty in this case. The fix for us was simply changing the path to something like:

/home/user/Projects/MyProject/tsconfig.json

Which works perfectly fine! Spaces didn't seem to be an issue in my tests.

Thanks again, and don't hesitate to reach out if you need further reproduction steps.

@benyap
Copy link
Owner

benyap commented Aug 12, 2024

Hi @tee-yankov, thanks for the issue!

Do you suspect that the spaces or the parentheses are causing the issue? And are you suggesting that resolve-tspaths is failing to find the tsconfig.json file, or the actual files that it needs to process?

Best way forward would be if you could provide an example repo that I could clone and run to investigate. 😁

@tee-yankov
Copy link
Author

Hey @benyap, thank you for the quick reply!

I'm pretty sure it's the parentheses that are causing the issue. It didn't seem like resolve-tspaths was unable to find the tsconfig.json file, but that it wasn't able to find any files for processing.

I will absolutely provide a repo where this is reproducible in the next few days, apologies for not doing it in the first place.

Thanks again!

@tee-yankov
Copy link
Author

Hey @benyap super sorry for the delay on this, but I was swamped. I've provided a repro repo here

Just please make sure to clone the project with something along the lines of

git clone git@github.com:tee-yankov/resolvepaths-repro-rpr-.git "resolvepaths-repro (rpr)"

so that the problematic characters are in the path. If you run npm run build like that, resolve-tspaths will find 0 files to process. If you just change the folder name to, for example resolvepaths-repro, then it correctly detects 1 file to process.

Cheers, and let me know if you need any further help from me!

@benyap
Copy link
Owner

benyap commented Sep 19, 2024

@all-contributors add @tee-yankov for bug report

Copy link
Contributor

@benyap

I've put up a pull request to add @tee-yankov! 🎉

@benyap benyap added the bug Something isn't working label Sep 19, 2024
@benyap
Copy link
Owner

benyap commented Sep 19, 2024

Hey @tee-yankov, thanks for your bug report and your patience. This has been fixed in v0.8.20 and should be available in the latest version of the package! (v0.8.22)

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

Successfully merging a pull request may close this issue.

2 participants