-
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
Compilation fails with TS6059 under Windows 10 but passes under Windows 11 or Linux #57926
Comments
Are you sure it's that specific PR? Or is it an estimate? That error code doesn't feel related and that PR probably wouldn't have affected anything but auto imports. https://www.npmjs.com/package/every-ts may help you narrow it down between those two nightly builds. |
I'm not sure, no - sorry if that wasn't clear. I'm certain that it started failing in the nightly 5.4.0-dev.20231222, and it was an educated guess based on the two merge commits that preceded that nightly build (but I could have been thrown off by point-of-reference conversion or misunderstanding the nightly build process. I'll take a look at every-ts and see if I can help to identify the exact change more accurately. |
In the meantime, I did discover one more piece of evidence that might be significant or help understand this problem. I enabled trace resolution and captured the output under different environments and can see that the issue seems to appear after a failed trace resolution, which only happens on Windows 10 when using TypeScript 5.4.0-dev.20231222 or later. This comes up part way through the build. Under Ubuntu using TypeScript 5.4.3, we get a successful build and this significant part of the trace:
Under Windows 10 using TypeScript 5.3.3 we get a successful build and this significant part of the trace:
And, in the equivalent part of the trace under Windows 10, which presumably relates to the first point of build failure based on a comparison of the trace output, we get:
* file names changed from our actual source but the structure is equivalent This seems to come up about 50k lines through the trace output, and prior to this point the trace output is largely similar with minor differences only. |
If you're confident about the two nightly versions then you're probably right about the PR, as that's the only change between them. Funky: 93e6b9d...fbcdb8c |
I gave every-ts a shot, and encountered problems when using the built version of typescript beneath ng-packagr. That aside, I am confident that the problem was introduced in 5.4.0-dev.20231222 The changeset in question touches the compiler core endsWith / startsWith in relation to case sensitivity which seems to be used for path matching, so I'd hazard a guess that something in this area might have had an impact. But, why this would be a problem in Windows 10 but is apparently fine under Windows 11 is beyond my understanding. |
One more thing that I just found is that the emitted .d.ts has changed and this seems to cause the problem. Using TypeScript nightly 5.4.0-dev.20231221 produces this which compiles successfully (this is one sample file, names changed from our codebase but illustrating the structure):
After updating to use TypeScript nightly 5.4.0-dev.20231222 we get this which does not compile:
It seems that these imports in the generated declaration files relate to defaulting generics. This may not be the full picture, but again, it might help to identify the problem. |
If it helps, I have prepared a Git repository that reproduces the problem. Repository: https://github.com/brodziakm/typescript-57926 Instructions are in the README.md, but, I'll include here for completeness: Successful build under TypeScript nightly 5.4.0-dev.20231221To reproduce the successful build (on Windows 10):
Failed build under TypeScript nightly 5.4.0-dev.20231222To reproduce the failed build (on Windows 10):
Note that this seems to work just fine under a Linux-based OS (but I have not tested exhaustively). ExplainerIn working through the issue I haven't (yet) been able to narrow the problem down in isolation. So, the included example is structured using Angular's 'ng-packagr', which generates Angular library bundles, including secondary entry points, from a structured folder layout. The provided structure illustrates one particular library that encounters a build-time problem in one of the secondary entry points. The 'ng-packagr' invocation leverages tsconfig.lib.json when building, and this configuration defines the appropriate library paths. These paths should be used in the generated declarations. The tsconfig.json in the same folder is configured so that the paths map to the source folders (which is a typical and convenient configuration for working in the IDE). This may or may not be significant. |
Possibly related: #57956 |
@brodziakm Can you try the build on #57973 (comment) to see if it fixes your issue? |
Ah, forgot you gave a case. I had to hack angular to accept a build >5.5.0, but it works! |
Wonderful! Thank you! |
π Search Terms
"TS6059", "Windows 10"
π Version & Regression Information
β― Playground Link
No response
π» Code
No response
π Actual behavior
When compiling under Ubuntu Linux (containerised or via WSL), or on Windows 11: compilation of all modules is successful.
When compiling under Windows 10: compilation fails with TS6059 errors.
π Expected behavior
Compilation is successful on all operating systems.
Additional information about the issue
We discovered this problem on a large existing Angular codebase a few days after updating to Angular 17.3 along with TypeScript 5.4.3. We didn't discover this immediately because our CI processes run in Linux, and the build passes quite happily under this OS.
To narrow down the issue I have tried retaining Angular 17.3 but downgrading to Typescript 5.3.3, and the build passes on Windows 10. I then tried various nightly builds and found that:
We subsequently tried building on a Windows 11 workstation (it passes), and via a WSL Ubuntu terminal (it also passes).
This leads me to believe that the changes under #55015 might have had an unexpected impact, particularly with regards to case insensitive paths specifically on Windows 10. I don't believe that Angular 17.3 has caused the problem because the problem does not exist when compiling under different versions of TypeScript.
I have been unable to narrow down a minimal reproduction of the problem because, other than the different operating system, it isn't clear what the specific problem is in the code.
For what it's worth, the Angular project is broken down into multiple libraries, and each library has multiple secondary entry points. We see one of the library secondary entry point builds fail with TS6059, but only under Windows 10. Some upstream libraries and library secondary entry points build correctly.
The text was updated successfully, but these errors were encountered: