Home > Enterprise >  vscode Ctrl Click on reactstrap module import { Nav } from 'reactstrap' shows References w
vscode Ctrl Click on reactstrap module import { Nav } from 'reactstrap' shows References w

Time:07-18

vscode Ctrl Click on reactstrap module import { Nav } from 'reactstrap' shows References window instead of js file

import React, { Component } from 'react'; Ctrl Click on React and Component opens index.d.ts files

Ctrl Click on the following opens References window instead of the defintion file. import { Nav, NavItem, Collapse } from 'reactstrap'; import classnames from 'classnames';

It seems like @types>module_names><> are working but others aren't.

CodePudding user response:

The following settings in .jsonconfig file helped resolve the issue. set "module": "CommonJS" or set "module": "Node16"

This was earlier set to "ESNext".

{
  "compilerOptions": {
    "baseUrl": "src",
    "module": "Node16"
  },
  "include": [
    "src"
, "public/src"  ]
}

OR

{
  "compilerOptions": {
    "baseUrl": "src",
    "module": "CommonJS"
  },
  "include": [
    "src"
, "public/src"  ]
}
  • Related