Skip to content
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 import not working in JSX #126781

Closed
gsriram24 opened this issue Jun 20, 2021 · 10 comments
Closed

Auto import not working in JSX #126781

gsriram24 opened this issue Jun 20, 2021 · 10 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s) upstream-issue-fixed The underlying upstream issue has been fixed

Comments

@gsriram24
Copy link

gsriram24 commented Jun 20, 2021

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.57.1
  • OS Version: Windows_NT x64 10.0.19043

Steps to Reproduce:

  1. Try to type in any JSX element, whether pre-installed or custom made components.

image
Auto import does not work for any of the JSX elements.

However, auto import works for functions such as useState. The issue is only with JSX elements.

@vscodebot
Copy link

vscodebot bot commented Jun 20, 2021

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@Bessonov
Copy link

Bessonov commented Jun 20, 2021

I'm not sure that I'm experiencing the same problem. After update from 1.56.2-1620838498 to 1.57.1-1623937013 vsc doesn't recognize ts/tsx exports from libraries. But I don't see any problem with own modules. Downgrade to 1.57.0-1623259737 doesn't help. Therefore I assume that this problem was introduced between 1.56.2 and 1.57.0.

@gsriram24
Copy link
Author

I didn't have this problem in the previous version, 1.56.2. Auto imports from libraries such as Material UI and also custom components worked perfectly.
Now neither of them works.

@iBhavesh
Copy link

I am having the same issue tried both tsx and jsx auto import is not working for either of them neither for custom component nor for other components from other module.s

@yuanworks
Copy link

yuanworks commented Jun 21, 2021

Also reproducible in MacOS Big Sur (11.0.1).

The only place auto import is working for me is in the imports section:

Screen Shot 2021-06-21 at 1 33 32 PM

After pressing tab, the auto import works. However, it doesn't show the usual "auto import from ..." popup.

@Torvaldi
Copy link

Torvaldi commented Jun 21, 2021

Reproducible in Linux Ubuntu 20.04.2.

When I'm trying to auto-import something, I got this error on developer console :
image

 ERR Running the contributed command: '_typescript.applyCompletionCommand' failed.: Error: Running the contributed command: '_typescript.applyCompletionCommand' failed.
    at _executeContributedCommand (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:84:108251)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)

@igorconde
Copy link

igorconde commented Jun 21, 2021

I'm having same issue, when downgrade for version 1.56 work normally.

@agcty
Copy link

agcty commented Jun 21, 2021

I have the same issue, auto import just doesn't work anymore. I just spent 2 days trying to fix my eslint config but I am 100% sure that it has to be vscode now.

@pedrocarlos-ti
Copy link

Same issue, downgrade to version 1.56 ( https://code.visualstudio.com/updates/v1_56 ) and works fine!

@mjbvz
Copy link
Contributor

mjbvz commented Jun 29, 2021

Duplicate of microsoft/TypeScript#44657

@mjbvz mjbvz marked this as a duplicate of microsoft/TypeScript#44657 Jun 29, 2021
@mjbvz mjbvz closed this as completed Jun 29, 2021
@mjbvz mjbvz added *duplicate Issue identified as a duplicate of another issue(s) upstream-issue-fixed The underlying upstream issue has been fixed labels Jun 29, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Aug 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s) upstream-issue-fixed The underlying upstream issue has been fixed
Projects
None yet
Development

No branches or pull requests

9 participants