resolve-tspaths
resolve-tspaths copied to clipboard
Paths with special characters are not properly handled
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.
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. 😁
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!
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 [email protected]: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!
@all-contributors add @tee-yankov for bug report