opened
dbaeumer
username_0
_From @username_3 on April 20, 2016 4:46_

- VSCode Version: 1.0.0
- OS Version: Windows 10 Pro

I have no extensions installed. node.js v5.10.1

Error highlighting has stopped working in our node.js app - I was able to reduce it to a very minimal test case:

A single index.js containing an erroneous line so you can see if error highlighting is on
A single subfolder containing a package.json with grunt and grunt-browserify packages and a node_modules folder created by running npm install against the package.json
Standard vscode files - .vscode/launch.json and jsconfig.json

Steps to Reproduce:

1. [Clone this repo](https://github.com/username_3/vscode-error-min/) or [recreate structure above from this gist](https://gist.github.com/username_3/da6bde225b114d9b8d9f7cf66772c0c9)
2. Navigate to ./sub and run `npm install`
3. Open main folder in VSCode
4. View ./index.js - there is no error highlighting

I have reproduced this on 3 machines

Almost any change to this minimum case, like removing the node_modules folder, removing `use strict` from the index.js etc., removing the vscode files etc. prevents the bug from being triggered, and error highlighting starts working again, however our app is not a minimal test case so knowing that isn't much help to us!

_Copied from original issue: Microsoft/vscode#5530_
JS error highlighting stops working in some cases
issue
created
dbaeumer
username_0
_From @username_3 on April 20, 2016 5:16_

BTW, there are a ton of ways to fix the min case so that it works, like adding node_modules to the exclude in jsconfig.json - but none of these fixes helps in our full app. Am at quite the loss as to how to proceed. Please let me know if I can provide any more info.

Intellisense is also down.
comment
created
dbaeumer
username_0
@username_3 thanks a lot for this nice test case. I was able to reproduce this immediately. First analysis shows that the tsserver which is powering JavaScript language smartness throws on reading the project info. We need to do two things here:

- let the user know that reading the project info failed.
- make a issue for the TS team.
comment
created
dbaeumer
username_0
![capture](https://cloud.githubusercontent.com/assets/1931590/14665462/b2a12394-06d3-11e6-96c5-c607d5c3282c.png)

Above the request / response trace I get in VSCode
comment
created
billti
username_1
@username_2 can you take a look and see why tsserver is having issues with this repro?
comment
created
zhengbli
username_2
This looks like the old issue where when the files in `node_modules` are included in the project, it takes a very long time to process the project. Because the project is not ready, asking for project info will result in an error message. https://github.com/Microsoft/TypeScript/pull/7486 is likely to fix the issue once it goes in. By default, the `node_modules` in the project root level will be excluded, however in his case the folder is inside a child folder `sub`, therefore its content is included. In fact, if waiting long enough, the error marks will show up eventually, it's just really slow right now.

Work around: edit the `jsconfig.json` so it looks like:
```
{
  "compilerOptions": {
    "target": "es6",
    "module": "commonjs"
  },
  "exclude": [
    "sub/node_modules"
  ]
}
```
comment
closed
zhengbli
username_2
issue
reopened
zhengbli
username_2
_From @username_3 on April 20, 2016 4:46_

- VSCode Version: 1.0.0
- OS Version: Windows 10 Pro

I have no extensions installed. node.js v5.10.1

Error highlighting has stopped working in our node.js app - I was able to reduce it to a very minimal test case:

A single index.js containing an erroneous line so you can see if error highlighting is on
A single subfolder containing a package.json with grunt and grunt-browserify packages and a node_modules folder created by running npm install against the package.json
Standard vscode files - .vscode/launch.json and jsconfig.json

Steps to Reproduce:

1. [Clone this repo](https://github.com/username_3/vscode-error-min/) or [recreate structure above from this gist](https://gist.github.com/username_3/da6bde225b114d9b8d9f7cf66772c0c9)
2. Navigate to ./sub and run `npm install`
3. Open main folder in VSCode
4. View ./index.js - there is no error highlighting

I have reproduced this on 3 machines

Almost any change to this minimum case, like removing the node_modules folder, removing `use strict` from the index.js etc., removing the vscode files etc. prevents the bug from being triggered, and error highlighting starts working again, however our app is not a minimal test case so knowing that isn't much help to us!

_Copied from original issue: Microsoft/vscode#5530_
JS error highlighting stops working in some cases
issue
created
nrkn
username_3
Brilliant. Though I'd already tried using `exclude` in our main app (not the minimal test) with no luck, I'd only been excluding a couple of things (including sub-folders' node_modules) and it is quite a large project. 

By knowing that this was the cause I was able to get error highlighting and intellisense back by aggressively adding more and more things to the exclude until they started working. 

Looking forward to being able to remove some of those things when this fix surfaces!
comment
created
zhengbli
username_2
@username_3 out of curiosity, what are the common folders that you need to exclude manually? Are these your source code files or libraries?
comment
created
nrkn
username_3
Our own source - now that I look over it to better answer your question, most of it can actually probably stay in `exclude` - it's mostly stuff like tests, browserified client js etc.
comment
closed
zhengbli
username_2
issue