-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Incorrect behavior for moduleResolution classic with relative paths #7051
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
Comments
Could be related to #5223 |
as bizarre as it may sound this is by design - |
@vladima , i'm quite positive that it can't be by design because it behaved as expected in tsc 1.5.3. That is unless 1.6 was a breaking change and both moduleResolution methods were different from 1.5, which seems quite wrong to me. I think you misunderstood and confused this to non-relative paths. Please correct me if I'm wrong. |
I've rechecked and yes in 1.5.3 behavior was slightly different:
To me this behavior is inconsistent, pinging @mhegazy for his opinion |
looks like a bug to me. |
discussed offline: we'll fix the behavior for
|
When using "moduleResolution" set to "classic", relative paths appear to be resolved in the same way as module paths, by looking at the parent folder. This behavior is incorrect and generates invalid paths.
Example:
This example should not compile. Tested with:
tsc 1.5.3 => doesn't compile (as expected)
tsc 1.6.2, 1.7.5 (moduleResolution = classic) => compiles
tsc 1.6.2, 1.7.5 (moduleResolution = node) => doesn't compile (as expected)
The text was updated successfully, but these errors were encountered: