Pavel L
Pavel L

Reputation: 2047

VSCode intellisense stopped working with js module import

When using javascript (es2015) imports the Intellisense refuses to work.

for example: import { } from 'react-router-dom' and hit [CTRL]+[SPACE] from within the curly braces of an import statement, there's no sign of suggestion, listing the module's exported entities.

When I try to import something exported with export default - there's also no suggestion.

my jsconfig.json

{
  "compilerOptions": {
    "target": "es6",
    "allowSyntheticDefaultImports": true
  },
  "exclude": [
    "node_modules",
    "**/node_modules/*"
  ],
  "include": [
    "src/**/*"
  ]
}

I'm using "allowSyntheticDefaultImports": true in order to handle export without default. I overuse exclude section, I know ))

VSCODE about

Version: 1.31.1
Commit: 1b8e8302e405050205e69b59abb3559592bb9e60
Date: 2019-02-12T02:19:29.629Z
Electron: 3.1.2
Chrome: 66.0.3359.181
Node.js: 10.2.0
V8: 6.6.346.32
OS: Linux x64 4.15.0-45-generic

otherwise everything , and intellisense in general works well

Upvotes: 0

Views: 318

Answers (1)

Jannick Breunis
Jannick Breunis

Reputation: 343

Two options that worked for me:

  1. The object's "build action" is set to none. Change this to Compile (worked with .cs tho).
  2. Close VS, delete the hidden ".vs" folder in explorer, next to your solution. Reopen VS.

Upvotes: 1

Related Questions