You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Referring to the same file with different casing causes empty output #122
I have an app that's roughly structured like this:
app
+-- main.ts
+-- Game
+-- Core.ts
+-- Net
+-- index.ts
main.ts referenced Game/Core.ts with the name app/Game/Core (correct), while Net/index.ts referenced it with app/game/Core (incorrect).
The result is that the output bundle is empty, with no errors or warnings reported. Fixing the casing to be correct in all cases fixes the issue, but an error would be nice.
This is on Windows 10, with tsify 0.14.1, Browserify 13.0.0, and TypeScript 1.8.9.
changed the title [-]Referring to the same file with different case causes empty output[/-][+]Referring to the same file with different casing causes empty output[/+]on Mar 28, 2016
Not sure what the appropriate fix is, necessarily. The problem is that since Windows is case-insensitive and pretty much everything elseLinux is case-sensitive, fixing this on Windows will break everywhere elseLinux. It could be platform-dependent behavior, I guess, but platform-dependent switches kind of suck for maintainability...
Obviously, "don't do that" (relying on case-insensitivity means you've made your project impossible to build on other platforms for no good reason) -- but error messages are kind of necessary to even diagnose the issue.
For reference, I actually first encountered this bug on OS X, which is also case-insensitive!
TypeScript seems to have gained a new option involving referencing files with different casing throwing errors. Does this problem happen at the TypeScript level or elsewhere?
If it's elsewhere, it might be possible to half-way fix the problem by detecting a case-sensitive filesystem and normalizing all paths down. I didn't see any ways to detect something like that out-of-the-box in Node.js, but there are some obvious ideas with some potential for false-positives.
TIL that OSX is case-insensitive too! (As I'm typing this on OSX, no less...)
My assumption is that the error happens at the level of the in-memory file store, which is keyed on (case-sensitive) filename. There might be a way of using the TS compiler's mechanism for detecting the problem, though... would be worth looking into.
This should be closed by #171. However, the changes in that PR weren't made to resolve this issue; its resolution is a side-effect. With said changes, the output bundle should contain what you'd expect. (However, that might not be the end of your problems, as I noticed that there were errors with paths in the source maps if there were mismatches in case. Probably best to ensure the case is correct, but I don't think it's up to tsify to check/enforce that.)
Activity
[-]Referring to the same file with different case causes empty output[/-][+]Referring to the same file with different casing causes empty output[/+]smrq commentedon Apr 4, 2016
What a bummer. I see why that happens...
Not sure what the appropriate fix is, necessarily. The problem is that since Windows is case-insensitive and
pretty much everything elseLinux is case-sensitive, fixing this on Windows will breakeverywhere elseLinux. It could be platform-dependent behavior, I guess, but platform-dependent switches kind of suck for maintainability...Obviously, "don't do that" (relying on case-insensitivity means you've made your project impossible to build on other platforms for no good reason) -- but error messages are kind of necessary to even diagnose the issue.
LPGhatguy commentedon Apr 4, 2016
For reference, I actually first encountered this bug on OS X, which is also case-insensitive!
TypeScript seems to have gained a new option involving referencing files with different casing throwing errors. Does this problem happen at the TypeScript level or elsewhere?
If it's elsewhere, it might be possible to half-way fix the problem by detecting a case-sensitive filesystem and normalizing all paths down. I didn't see any ways to detect something like that out-of-the-box in Node.js, but there are some obvious ideas with some potential for false-positives.
smrq commentedon Apr 4, 2016
TIL that OSX is case-insensitive too! (As I'm typing this on OSX, no less...)
My assumption is that the error happens at the level of the in-memory file store, which is keyed on (case-sensitive) filename. There might be a way of using the TS compiler's mechanism for detecting the problem, though... would be worth looking into.
cartant commentedon Aug 7, 2016
This should be closed by #171. However, the changes in that PR weren't made to resolve this issue; its resolution is a side-effect. With said changes, the output bundle should contain what you'd expect. (However, that might not be the end of your problems, as I noticed that there were errors with paths in the source maps if there were mismatches in case. Probably best to ensure the case is correct, but I don't think it's up to
tsifyto check/enforce that.)