-
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
Auto-imports from within jsx don't work #44657
Comments
I can't see the component name in other components. Intellisense/autocomplete not working. Doesn't work on auto import. |
For me, the issue seems to be related to path-aliases in {
"compilerOptions": {
"paths": {
"@components/*": ["src/components/*"],
"@views/*": ["src/views/*"],
"@api/*": ["src/api/*"],
"@context/*": ["src/context/*"]
}
}
} If i remove these entries, some imports work (e.g. while typing the name of a component), while others (e.g. |
I am experiencing the same issue. I also tested on the latest insider build and the issue persists. @H1ghBre4k3r What's weird is that I thought it was related to the paths but then I made a fresh create-react-app js project and the imports still don't work accurately. I did add a custom paths in my tsconfig and then the issue started happening across any folder. EDIT: I renamed App.js to App.jsx and the auto import worked (v. 1.55). Testing with Insider Build now EDIT 2: Did not work on latest insider build (v. 1.58.0-insider) |
Seems to be related to microsoft/vscode#126095. I also experienced "working" intellisense/imports after randomly deleting characters in the name of the component i want to import (probably related to the slow intellisense). |
We've had similar problems with auto-suggest not suggesting anything inside node_modules folder. Forcing vscode to use the workspace typescript version worked for us. |
I've been experiencing the issue exactly as described, with the same VS Code version (1.57.0) and OS (Catalina 10.15.7). The only known workaround appears to be typing the component name outside of JSX. Additional info:
|
So I am on VS Code Version 1.57 and running TypeScript Version 4.4.0-dev.20210615 and local imports and working again 😊 |
Just tested with create react app but it seems to work in 4.3.2. Please share an example project that demonstrates the issue so we can investigate |
Version: 1.57.0 (user setup) typescript: 4.3.2 Reproduce step:
open the let a = <Modal/>;
let b = <Table/>;
let c = <Form/>;
let d = <Input/>; Please try them. As I tested, only |
@SKumarSpace tried this, still not working |
@mjbvz Here's a reproduction: https://github.com/selrond/vscode-imports-reproduction |
I have this issue too with ts and js, tried on a cra js project and a next ts project. [email protected], expecially with Material-UI framework. Works as intended on 1.56. Downgrading vscode for now. Very bad. |
@andrewbranch Can you help take a look at this issue? We've seen a few reports on the VS Code side after the TS 4.3 update |
Any news guys. Or should we rollback to previous version vscode? |
@mjbvz try |
we have the same issue. |
just tried what @donni106 mentioned, didn't seem to help at all |
1 similar comment
This comment has been minimized.
This comment has been minimized.
After I disable extension "JavaScript and TypeScript Nightly", it worked. Let's try ! |
It;s working now on vscode June update |
it work again after I update the JavaScript and TypeScript Nightly extension |
Auto imports inside jsx stopped working on the latest stable release - worked before.
When I try to use auto import, it show correct info about the identifier, but no way to auto import it:
However, whn I use auto import outside of jsx, it works (shows correct path and auto-imports on confirm):
Does this issue occur when all extensions are disabled?: Yes/No
Yes
Steps to Reproduce:
The text was updated successfully, but these errors were encountered: