Skip to content

jsconfig.json sometimes not taken into account #703

Closed

Description

Hi.

Thanks for your product, I really enjoy using it. However I have one problem:
When using ES6 features, like the arrow functions, I get the message "This can only be used with ES6. Make sure to have a jsconfig.json-file which sets the target to ES6".

However I have a jsconfig.json-file in my root (the folder opened in Visual Studio Code), which contains:

{
    "compilerOptions": {
        "target": "ES6",
        "module": "commonjs"
    }
}

The weird part is that I get it for some files, and not for others. Even if the files are in the same directory. Right now I have three files in the subdirectory /app/bpm names bpm.js, bpmController.js and enterClick.js. All three are written with ES6-functionality, but I only get the warning and red underlined text for bpm.js.

UPDATE:
I just restarted VS Code, and the red underline disappeared from bpm.js too. It was a new file I had created after the two others, however the red underline only went away after a restart.

Activity

  1. changed the title [-]jsconfig.json sometimes not being read.[/-] [+]jsconfig.json sometimes not taken into account[/+] on Nov 26, 2015
  2. skovmand commented on Nov 26, 2015

    @skovmand
    Author

    I just reproduced it again. Made a new directory, and moved a file into it. Everything gets the red underline and the warning "This can only be used with ES6. Make sure to have a jsconfig.json-file which sets the target to ES6".

    Restart VSCODE and it goes away.

  3. gerrywastaken commented on Nov 26, 2015

    @gerrywastaken

    I have the same problem except while restarting normally fixes this, in this case it's still no working after a restart for a file called schema.js

  4. added
    bug
    javascript
    on Nov 26, 2015
  5. jaccus commented on Nov 26, 2015

    @jaccus

    This bug makes VS Code completely unusable for ES6 development since the whole editor is obfuscated with red underlines.

    I sometimes manage to get it resolved by editing jsconfig.json (add whitespace, save) but then again, only sometimes.

    Sounds quite critical to me?

  6. warpdesign commented on Nov 26, 2015

    @warpdesign
    Contributor

    +1
    Same problem, had to disable builtin js validation.

  7. nverba commented on Nov 27, 2015

    @nverba

    +1 This is driving me mental! Completely random too.

  8. jrieken commented on Nov 27, 2015

    @jrieken
    Contributor

    I can reproduce with a simple sample but after a short while (2-3 seconds) it recovers. I guess you guys are dealing with large projects?

  9. mbarzeev commented on Nov 30, 2015

    @mbarzeev

    +1
    This is very annoying, and as others have mentioned - this is a key feature.

  10. skovmand commented on Nov 30, 2015

    @skovmand
    Author

    Johannes Rieken (@jrieken) My project is about 25 .js-files in different subdirectories. The tree is up to 3 directories deep.

  11. added
    important
    on Nov 30, 2015
  12. nrkn commented on Dec 1, 2015

    @nrkn

    How's this for bizarre - I'm getting this same issue in my project, but only in a handful of files that start with the word 'template', like template-controller.js etc. - however, not with templates.js

    The affected files are:

    /controllers/template-controller.js
    /controllers/template-create-controller.js
    /controllers/template-edit-controller.js
    /api/template-api.js
    /template-engine.js
    

    There are maybe ~100 other .js files where the red underlines don't appear when using ES6 syntax

    My colleague had the same issue, but it went away when he restarted VSCode - that doesn't work for me, makes no difference, nor does editing and resaving the jsconfig.json.

  13. Cirych commented on Dec 1, 2015

    @Cirych

    On Windows VSCode can see jsconfig.json and work properly. But when open project from network drive, VSCode can't see jsconfig.json and show errors on ES6 code.

    I have project on VM centos and map a Windows network drive to projects folder. All right, except ES6 errors.
    When I copied project to Windows local folder - everything seems Ok with ES6 speling.

  14. 24 remaining items

  15. jrieken commented on Dec 8, 2015

    @jrieken
    Contributor

    Closing, the remaining work wrt to shebang and files with an extension will be tackled in #1097.

  16. dbaeumer commented on Dec 16, 2015

    @dbaeumer
    Member

    Johannes Rieken (@jrieken) can you please add steps for verification

  17. jrieken commented on Dec 16, 2015

    @jrieken
    Contributor
  18. mdpratt commented on Feb 1, 2016

    @mdpratt

    I'm still having the same issue as Kirill Ezhemenskii (@Cirych). When opening a folder over a mapped network drive (in this case opening my Linux folder on Windows). Opening the folder while mapped causes VSCode to show everything as syntax errors. Copying my code over to Windows and then opening VSCode to the new folder causes errors to disappear and for intelliSense to work again.

  19. lironka commented on Feb 27, 2016

    @lironka

    I have this error too. I try write ES6 in root site files (etc. wabpack.config.js, test.js) and have red underlined. jsconfig.json - doesn't work!

  20. StarpTech commented on Mar 10, 2016

    @StarpTech

    Same issue. Using jsconfig.json doesn't work. e.g const keyword is red underlined.

  21. matthiasg commented on Apr 19, 2016

    @matthiasg

    Same issue here. In one project it works in another (was a copy of the first) it doesnt. Same content in jsconfig.json. Typings are underlined though.

  22. mortonprod commented on Jul 20, 2016

    @mortonprod

    I also have the same issue using the gulp file from this tutorial:
    http://www.mithunvp.com/angular-2-in-asp-net-5-typescript-visual-studio-2015/

    The arrow function is the issue. I include the needed jsconfig and nothing? Has anyone solved this yet?

  23. malte-timmermann commented on Oct 12, 2016

    @malte-timmermann

    I also have the issue the jsconfig.json is not being read.

    Tested with Visual Studio Code v1.5.3 and v1.7.0 insider, on Windows x64 (version 1607).

    When using Sysinternals process monitor, I see that VC Code is getting some information about jsconfig.json (QueryAllInformationFile), but does NOT read the file (ReadFile).

    Log when opening VS Code (with the current project) (reduced to jsconfig.json and my test file)

    http://pastebin.com/GTKHPCZC

    Log when actually opening jsconfig.json inside VS Code (so something like that should also happen when launching VS Code):

    http://pastebin.com/je8Y3p4C

    Not reading jsconfig.json unfortunately means that "go to definition" doesn't work for me with my own js files, what hinders me from switching from Netbeans to VS Code :(

    I would really appreciate if this issue could be fixed. If you need further information, or my stripped down example, just let me know!

  24. malte-timmermann commented on Oct 12, 2016

    @malte-timmermann

    I just saw that this bug is closed - will open a new/fresh one...

  25. locked and limited conversation to collaborators on Nov 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugimportantjavascriptverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions