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
[Bug] Paths needlessly go back to root on macOS #167
Comments
Hello. That is an interesting problem. I think the best route would be to do some debugging in this function
Or the one which calls it to determine where and why we got a lowercase version. Looks like there may also be some promise here: ATM, I don't have the bandwidth to investigate it deeper, but if you'd like to help track down where the issue is, I'd be happy to help get a fix through. |
I have a patch we're using locally that uses |
@nathtumlin-tanium Ok, great. If you can tell me where you patched it, I can push a fixed version. |
I replaced the calls to Sorry, my company is a little strange about contributing code externally but hopefully that's enough to get it, it should be like a < 20 line diff. |
fixes so all paths dont get rewritten to `../../../../../../../users/...` on osx fixes LeDDGroup#167
@nathtumlin-tanium can you confirm the PR #171 is inline with your expectations? It works perfectly for my system but just in case I may have missed an edge case? |
Yep, that's essentially the same as what we're doing. Thanks! |
macOS has case-insensitive filenames and in resolve-module-name.ts
srcFileOutputDir
has a path starting with/Users/
andmoduleFileOutputDir
has a path starting with/users/
code link. This means that thepath.relative
call ends up..
ing all the way back up to/
and creating a path likerequire('../../../../../users/nath/foo/src/bar')
.I did some digging and it looks like in the
SourceFile
objects returned from the compiler API'sgetSourceFiles
thefileName
property has an uppercaseUsers
and is constructed by concatting things withprocess.cwd()
and things likepath
andresolvedPath
have the lowercaseusers
and I'm not sure where those come from.Any thoughts on how to fix this either through code changes or a config change? Right now I'm just modifying the
path.relative
call to add some.toLowerCase()
's, but that won't work in general.The text was updated successfully, but these errors were encountered: