-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Confusing behavior with tsconfig and alias in some cases #5351
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
Turns out it is possible to omit the I guess the best option is to add a Vite path alias as mentioned in the issue. |
Fixes #5351 Also a drive-by-remove of some obsolete code
Fixes #5351 Also a drive-by-remove of some obsolete code
Fixes #5351 Also a drive-by-remove of some obsolete code
* fix: remove baseUrl to prevent wrong TypeScript auto imports Fixes #5351 Also a drive-by-remove of some obsolete code * how the hell did this happen
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
If you import something from a folder which isn't aliased, intellisense will suggest imports which are resolvable by TypeScript but not Vite.
Reproduction
Consider this folder structure:
If you import something from
routes
that is withinutils
you'll get the following suggestion:import X from "src/utils/x
. Reason: The generatedtsconfig.json
contains"baseUrl": "."
. In the eyes of TS this is a correct import path due to the base path alias, in the eyes of Vite it's not because we don't define such an alias (only$lib
by default).I'm not sure of the best solution here. Maybe we should always add an alias to Vite that resolves
src/..
toreal/path/to/src
.Logs
No response
System Info
Severity
annoyance
Additional Information
No response
The text was updated successfully, but these errors were encountered: