You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am incorrectly getting the following error, "This can only be used with ES6. Make sure to have a jsconfig.json-file which sets the target to ES6".
Furthermore, I think I may have stumbled upon a weird case where if the start of the file name is "temp" as in "temp.js", "temporary.js", or "temp123.js" it will cause this error.
To reproduce:
Create a file called temp.js with some ES6 code, such as:
let x = 10
The above error is now showing. To fix it, create the jsconfig.json file which sets the target to ES6:
{
"compilerOptions": {
"target": "ES6"
}
}
The error is still showing, now incorrectly.
If I rename "temp.js" to "test.js" (or anything that doesn't start with 'temp') the error goes away. Or, if I create a files array in jsconfig.json which lists "temp.js", the error goes away:
I am having related issues to this, and wasn't really sure how to fix it. It seems to happen a lot for new files, but if I save the file, close VS Code and reopen it, the errors go away. Editing jsconfig.json and saving it seems to correct the issue as well, doesn't seem to matter what changes I made the jsconfig, just that it did change.
Taka Kojima (@gigafied) what naming convention were you using for your files when you had the errors. I also found that restarting in conjunction with dropping my myfile.controller.js convention for a more straight forward myfileController.s seemed to clear the es6 messages. So like you say it is possible that it is just a new file thing.
I get it even if I rename an existing file, from Something.js to SomethingElse.js, but indeed, if i just edit jsconfig.json and add a insignificant space somewhere, then hit save, everything starts working again.
+1
It's wired for me, in some files in my project it's work in others not. I'm using a the jsconfig.jscon without a file configuration. Sometimes it works for a few hours and then the "This can only be used with ES6. Make sure to have a jsconfig.json-file which sets the target to ES6" error comes back.
Activity
lllama commentedon Nov 18, 2015
I'm seeing a similar thing when editing Vue files (http://vuejs.org/guide/application.html#Single_File_Components). These are HTML-like and will have a script tag that contains JS.

I have the following jsconfig.json file:
{ "compilerOptions": { "target": "ES6", "module": "system" }, "files": [ "Editor.vue" ] }(with Editor.vue being my file). I'm manually setting the filetype to HTML as well.
warpdesign commentedon Nov 18, 2015
+1
@ron-wade noticed that as well. Ended up using jshint instead.
garethfentimen commentedon Nov 18, 2015
+1
I am using: export default angular.module('thingsModule', []);
[Just installed latest update - looks like its resolved... impressive]
r25s commentedon Nov 18, 2015
Gareth (@garethfentimen) might be a different problem you were having, as I am the issue with the latest release: 0.10.1.
gigafied commentedon Nov 19, 2015
I am having related issues to this, and wasn't really sure how to fix it. It seems to happen a lot for new files, but if I save the file, close VS Code and reopen it, the errors go away. Editing
jsconfig.jsonand saving it seems to correct the issue as well, doesn't seem to matter what changes I made the jsconfig, just that it did change.garethfentimen commentedon Nov 19, 2015
Taka Kojima (@gigafied) what naming convention were you using for your files when you had the errors. I also found that restarting in conjunction with dropping my myfile.controller.js convention for a more straight forward myfileController.s seemed to clear the es6 messages. So like you say it is possible that it is just a new file thing.
gigafied commentedon Nov 19, 2015
I get it even if I rename an existing file, from
Something.jstoSomethingElse.js, but indeed, if i just editjsconfig.jsonand add a insignificant space somewhere, then hit save, everything starts working again.fxOne commentedon Nov 19, 2015
+1
It's wired for me, in some files in my project it's work in others not. I'm using a the
jsconfig.jsconwithout a file configuration. Sometimes it works for a few hours and then the "This can only be used with ES6. Make sure to have a jsconfig.json-file which sets the target to ES6" error comes back.kuashe commentedon Nov 19, 2015
+1 Having the same issue
sbrinkmann commentedon Nov 19, 2015
+1
jrieken commentedon Dec 4, 2015
Making this a duplicate of #703. There are a few things off when it comes to jsconfig.json and I trying to tackle them for Dec15