microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.24k stars 28.88k forks source link

AutoImport not working for NPM packages, only in JS/JSX #67126

Closed CharlieIGG closed 5 years ago

CharlieIGG commented 5 years ago

Issue Type: Bug

I have this weird issue where AutoImport won't work for NPM packages when using JS or JSX. However it DOES work for:

I haven't found any issue quite like this, so I finally decided to ask for clues. Any hints at how to fix this would be greatly appreciated.

VS Code version: Code 1.30.2 (61122f88f0bf01e2ac16bdb9e1bc4571755f5bd8, 2019-01-07T22:48:31.260Z) OS version: Darwin x64 18.2.0

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz (12 x 2200)| |GPU Status|2d_canvas: enabled
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: enabled
rasterization: enabled
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled| |Load (avg)|2, 2, 2| |Memory (System)|16.00GB (1.47GB free)| |Process Argv|| |Screen Reader|no| |VM|0%|
Extensions (39) Extension|Author (truncated)|Version ---|---|--- scss-lint|ada|0.1.8 rails-partial|aki|0.1.0 jest-snippets|and|1.6.1 ng-template|Ang|0.1.11 rails|bun|0.8.6 vscode-gemfile|bun|0.0.2 solargraph|cas|0.19.1 npm-intellisense|chr|1.3.0 bracket-pair-colorizer|Coe|1.0.61 ionic3-vs-ionView-snippets|dan|1.0.2 vscode-markdownlint|Dav|0.23.0 vscode-eslint|dba|1.8.0 tslint|eg2|1.0.42 vsc-material-theme|Equ|2.6.3 prettier-vscode|esb|1.7.3 todo-tree|Gru|0.0.115 beautify|Hoo|1.4.7 RelativePath|jak|1.4.0 vscode-styled-components|jpo|0.0.25 rspec-snippets|kar|0.0.4 coffeelinter|lky|1.4.0 vscode-language-babel|mgm|0.0.21 dotenv|mik|1.0.1 ruby-rubocop|mis|0.7.1 vscode-elixir|mjm|1.1.0 vscode-postcss-sorting|mrm|3.0.1 vscode-scss|mrm|0.6.2 atom-keybindings|ms-|3.0.5 debugger-for-chrome|msj|4.11.1 color-highlight|nau|2.3.0 vscode-docker|Pet|0.5.1 material-icon-theme|PKi|3.6.2 ruby|reb|0.21.0 slim|sia|0.1.2 addDocComments|ste|0.0.8 highlight-matching-tag|vin|0.8.6 simple-ruby-erb|vor|0.2.1 vscode-js-import|wan|0.15.4 change-case|wma|1.0.0
mjbvz commented 5 years ago

Does this reproduce in the latest VS Code insiders build with all extensions disabled?

CharlieIGG commented 5 years ago

I'll check it out tomorrow early @mjbvz , thanks for the followup

mjbvz commented 5 years ago

Closing as we need more information to investigate. @CharlieIGG if this still occurs in the latest VS Code release, please let me know

CharlieIGG commented 5 years ago

Guys, my bad. This was in the docs. For the reference of anybody else who stumbles into this:

👉TS projects seems to have no issue regardless of the config, but 👉More often than not, Javascript projects will require the presence of a jsconfig.json file, with at least a basic config as this:

{
    "compilerOptions": {
        "target": "ES6"
    },
    "exclude": [
        "node_modules",
        "**/node_modules/*"
    ]
}

Thank you @mjbvz