-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
forceConsistentCasingInFileNames
doesn't work for modules in node_modules
#49470
Comments
I think this might be introduced in #44966 |
We also have (even worse) trouble under Windows with |
News on this:
It turned out this was not the root of the problem, but instead, the issue occurs when TypeScript tries to normalize paths with more than 260 characters using So the fix could be to fall back to I could create a dedicated bug report and a PR for that fix, but it would be quite hard to implement a test or even a reproducer, because the error only occurs under such specific, OS-dependent conditions. |
@fwienber thank you for getting to bottom of this.. Have PR #50306 up to fix this.. Can you try the build out and see how it is working out for you. Bot should comment on the PR when the build is ready for you to try it out. Thanks Update: Build is available at #50306 (comment) |
Already fixed and arrived on main branch! 😲 Just one caveat: The logic explicitly checking for the 260 character limit might fail when calling the utility method with a relative path. Such paths are resolved against the current working directory ( My proposed alternative fix, catching all "file not found" ( Thank you again for your fast reaction and fix! |
One more thing, are you sure the original issue by @OliverJAsh is also resolved by this fix? |
Process question: Will there be a 4.7.x release with this fix? Or only 4.8.x? Or maybe even only 4.9? |
My mistake that i somehow thought the additional debugging that @fwienber did was related to original issue. Keeping this open as it is separate issue. |
Yes the paths are expected to be full paths so this should never arise and in almost all cases if this is because of using relative path the issue would need fix somewhere else to make sure path is not relative to current directory
Precisely why we are checking the path length and not handling exceptions so that we dont get perf hit on common scenarios. |
Component commits: b73d93b On windows handle the long paths in realpathSync.native Fixes microsoft#49470
Component commits: b73d93b On windows handle the long paths in realpathSync.native Fixes microsoft#49470 Co-authored-by: Sheetal Nandi <shkamat@microsoft.com>
Component commits: 4a808aa Add tests when realpath supresses the casing error 97011d6 Fix when real path results in value that differs only in case Fixes microsoft#49470 1e62da1 Comment
…lvedFileName before realpath so that errors can be reported with forceConsistentCasingInFileNames (microsoft#50364) * Add tests when realpath supresses the casing error * Fix when real path results in value that differs only in case Fixes microsoft#49470 * Comment
Component commits: 4a808aa Add tests when realpath supresses the casing error 97011d6 Fix when real path results in value that differs only in case Fixes microsoft#49470 1e62da1 Comment Co-authored-by: Sheetal Nandi <shkamat@microsoft.com>
@sheetalkamat I can still reproduce this in TS 4.8, with a slightly different test case. You will need to run import * as xs1 from "fp-ts/lib/struct";
// Error as expected ✅
import * as xs2 from "fp-ts/lib/Struct";
import * as xs3 from "fp-ts/struct";
// Expected error, but got none ❌
import * as xs4 from "fp-ts/Struct";
❯ cat node_modules/fp-ts/struct/package.json
{
"main": "../lib/struct.js",
"module": "../es6/struct.js",
"typings": "../lib/struct.d.ts",
"sideEffects": false
} |
@OliverJAsh i dont think that case ever worked so that isnt regression per say.. This isnt something program can report easily either because package.json path's arent compared for file casing and typings for it points to lower case struct.d.ts so the resulting file will have correct casing.. So opening separate issue to track this |
Bug Report
🔎 Search Terms
forceConsistentCasingInFileNames
node_modules
🕗 Version & Regression Information
forceConsistentCasingInFileNames
⏯ Playground Link
Not available—requires
node_modules
folder💻 Code
With
forceConsistentCasingInFileNames
enabled andfp-ts
installed innode_modules
:src/struct.d.ts
:🙁 Actual behavior
See code comments above.
🙂 Expected behavior
See code comments above.
The text was updated successfully, but these errors were encountered: