-
Notifications
You must be signed in to change notification settings - Fork 31.5k
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
Auto imported file path is wrong (absolute vs relative) and raises error at runtime #137446
Comments
/needsMoreInfo Do you have these folders in |
I don't have any "baseUrl": "",
"paths": {
"shared/*": ["shared/*"]
}, But anyway I would like any folder to import correctly, shared is just an example. tsconfig is the same as this. Also the project strucure is very similar to that repo. |
Please share a minimal example project that demonstrates the issue |
Ok I found that it happens in the parent project too, so you can repro with this:
|
Have you tried configuring |
This works! I didn't know about this config. I wonder now if |
Thanks for testing! Closing as by-design / question The type of the path used by default depends on your jsconfig / tsconfig. Try changing it something like The setting then offers more fine grained control over which path style is selected |
Does this issue occur when all extensions are disabled?: Yes
Steps to Reproduce:
server/validators/*
andserver/shared/*
server/shared/constants.ts
toserver/validators/file.ts
the import string is:import { usernameRegexp } from 'shared/constants';
that gives me an error because the correct path should be:import { usernameRegexp } from '../shared/constants';
Short vid of what I mean with autoimport:
recordautoimport.mp4
The text was updated successfully, but these errors were encountered: