Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NONE of the code features work in ES6 projects for language type: Javascript #2054

Closed
AndrewRayCode opened this issue Jan 16, 2016 · 17 comments
Assignees
Labels
javascript JavaScript support issues upstream Issue identified as 'upstream' component related (exists outside of VS Code)

Comments

@AndrewRayCode
Copy link

See GIF again:

vs-code-why

Literally none of the editor features work.

My jsconfig.json:

{
    "compilerOptions": {
        "target": "ES6",
        "module": "commonjs"
    },
    "exclude": [
        "node_modules"
    ]
}
@okian
Copy link

okian commented Jan 16, 2016

It's not related but i'm just curious to know how do you capture your gifs? I capture the screen with Quicktime and then convert that to gif. Is there any better solution (direct / 1 phase) for that?

@AndrewRayCode
Copy link
Author

I use LiceCap

@felixfbecker
Copy link
Contributor

@moostad I can recommend ScreenToGif :)

@isidorn isidorn added the javascript JavaScript support issues label Jan 18, 2016
@egamma egamma assigned egamma and unassigned jrieken Jan 18, 2016
@egamma
Copy link
Member

egamma commented Jan 18, 2016

@jrieken let me take this one. I'll try to come up with repro steps.

@egamma
Copy link
Member

egamma commented Jan 18, 2016

@delvarworld I've tried to reproduce it with a minimal setup and things work fine (see gif below). Since ES6 is now the default you no longer need to define it as the target in the jsconfig.json.

Since you do not even get a hover over angle hints at that Code's JavaScript worker has crashed. In this case you should see an exception in the console. Can you open the developer tools Help>Toggle Developer Tools and switch to the Console tab. Does an error show up?

Can you reproduce the above problems after a fresh restart?

Did you get into this situation after #1991? In this case the the JS worker will have crashed. The work around is to restart Code cmd+p, Reload Window.

Do you have any extensions installed (e.g. eg2.js-is-jsx)? Can you try to reproduce the problem when you start code with the --disable-extensions option.

bug2045

@egamma egamma added the info-needed Issue requires more information from poster label Jan 18, 2016
@AndrewRayCode
Copy link
Author

I checked the console, looks like vscode crashes on startup (before I type anything):

Main Thread sent to worker the following message:e._onError @ workbench.main.js:16e._onmessage @ workbench.main.js:16e._onSerializedMessage @ workbench.main.js:16(anonymous function) @ workbench.main.js:16worker.onmessage @ workbench.main.js:19
workbench.main.js:16 Object {type: "threadService", payload: Array[3]}
workbench.main.js:16 And the worker replied with an error:e._onError @ workbench.main.js:16e._onmessage @ workbench.main.js:16e._onSerializedMessage @ workbench.main.js:16(anonymous function) @ workbench.main.js:16worker.onmessage @ workbench.main.js:19
workbench.main.js:16 Object {stack: "RangeError: Maximum call stack size exceeded↵    a…escript/common/lib/typescriptServices.js:10:5103)", message: "RangeError: Maximum call stack size exceeded"}
workbench.main.js:91 RangeError: Maximum call stack size exceeded: RangeError: Maximum call stack size exceeded
    at o (typescriptServices.js:10)
    at n (typescriptServices.js:10)
    at r (typescriptServices.js:10)
    at o (typescriptServices.js:10)
    at n (typescriptServices.js:10)
    at r (typescriptServices.js:10)
    at o (typescriptServices.js:10)
    at n (typescriptServices.js:10)
    at r (typescriptServices.js:10)
    at o (typescriptServices.js:10)e.onUnexpectedError @ workbench.main.js:91(anonymous function) @ workbench.main.js:91e.onUnexpectedError @ workbench.main.js:10u @ workbench.main.js:10e._onmessage @ workbench.main.js:16e._onSerializedMessage @ workbench.main.js:16(anonymous function) @ workbench.main.js:16worker.onmessage @ workbench.main.js:19
workbench.main.js:16 Main Thread sent to worker the following message:e._onError @ workbench.main.js:16e._onmessage @ workbench.main.js:16e._onSerializedMessage @ workbench.main.js:16(anonymous function) @ workbench.main.js:16worker.onmessage @ workbench.main.js:19
workbench.main.js:16 Object {type: "threadService", payload: Array[3]}
workbench.main.js:16 And the worker replied with an error:e._onError @ workbench.main.js:16e._onmessage @ workbench.main.js:16e._onSerializedMessage @ workbench.main.js:16(anonymous function) @ workbench.main.js:16worker.onmessage @ workbench.main.js:19
workbench.main.js:16 Object {stack: "RangeError: Maximum call stack size exceeded↵    a…ript/common/js/importAndExportRewriter.js:4:5389)", message: "RangeError: Maximum call stack size exceeded"}
workbench.main.js:91 RangeError: Maximum call stack size exceeded: RangeError: Maximum call stack size exceeded
    at e.visitBinaryExpression (importAndExportRewriter.js:4)
    at importAndExportRewriter.js:4
    at r (typescriptServices.js:10)
    at Object.o [as forEachChild] (typescriptServices.js:10)
    at e._visitNode (importAndExportRewriter.js:4)
    at e.visitBinaryExpression (importAndExportRewriter.js:4)
    at importAndExportRewriter.js:4
    at r (typescriptServices.js:10)
    at Object.o [as forEachChild] (typescriptServices.js:10)
    at e._visitNode (importAndExportRewriter.js:4)e.onUnexpectedError @ workbench.main.js:91(anonymous function) @ workbench.main.js:91e.onUnexpectedError @ workbench.main.js:10u @ workbench.main.js:10e._onmessage @ workbench.main.js:16e._onSerializedMessage @ workbench.main.js:16(anonymous function) @ workbench.main.js:16worker.onmessage @ workbench.main.js:19
javascript.js:4 Object {stack: "RangeError: Maximum call stack size exceeded↵    a…ript/common/js/importAndExportRewriter.js:4:5389)", message: "RangeError: Maximum call stack size exceeded"}
typescriptServices.js:10 Uncaught RangeError: Maximum call stack size exceededr @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10e @ typescriptServices.js:10r @ typescriptServices.js:10o @ typescriptServices.js:10
workbench.main.js:16 Main Thread sent to worker the following message:e._onError @ workbench.main.js:16e._onmessage @ workbench.main.js:16e._onSerializedMessage @ workbench.main.js:16(anonymous function) @ workbench.main.js:16worker.onmessage @ workbench.main.js:19
workbench.main.js:16 Object {type: "threadService", payload: Array[3]}
workbench.main.js:16 And the worker replied with an error:e._onError @ workbench.main.js:16e._onmessage @ workbench.main.js:16e._onSerializedMessage @ workbench.main.js:16(anonymous function) @ workbench.main.js:16worker.onmessage @ workbench.main.js:19
workbench.main.js:16 Object {stack: "RangeError: Maximum call stack size exceeded↵    a…escript/common/lib/typescriptServices.js:10:5103)", message: "RangeError: Maximum call stack size exceeded"}
workbench.main.js:91 RangeError: Maximum call stack size exceeded: RangeError: Maximum call stack size exceeded
    at o (typescriptServices.js:10)
    at e (typescriptServices.js:10)
    at r (typescriptServices.js:10)
    at o (typescriptServices.js:10)
    at e (typescriptServices.js:10)
    at r (typescriptServices.js:10)
    at o (typescriptServices.js:10)
    at e (typescriptServices.js:10)
    at r (typescriptServices.js:10)
    at o (typescriptServices.js:10)e.onUnexpectedError @ workbench.main.js:91(anonymous function) @ workbench.main.js:91e.onUnexpectedError @ workbench.main.js:10u @ workbench.main.js:10e._onmessage @ workbench.main.js:16e._onSerializedMessage @ workbench.main.js:16(anonymous function) @ workbench.main.js:16worker.onmessage @ workbench.main.js:19
javascript.js:4 Object {stack: "RangeError: Maximum call stack size exceeded↵    a…escript/common/lib/typescriptServices.js:10:5103)", message: "RangeError: Maximum call stack size exceeded"}
index.html?config={"pathArguments"%3A[]%2C"programStart"%3A0%2C"workers"%3A-1%2C"enablePerformance"…:24 [uncaught exception]: TypeError: Cannot convert object to primitive valueonError @ index.html?config={"pathArguments"%3A[]%2C"programStart"%3A0%2C"workers"%3A-1%2C"enablePerformance"…:24(anonymous function) @ index.html?config={"pathArguments"%3A[]%2C"programStart"%3A0%2C"workers"%3A-1%2C"enablePerformance"…:96emitOne @ events.js:77emit @ events.js:169window.onerror @ /Applications/Visual Studio Code.app/Contents/Resources/atom.asar/renderer/lib/init.js:70t @ workbench.main.js:45
index.html?config={"pathArguments"%3A[]%2C"programStart"%3A0%2C"workers"%3A-1%2C"enablePerformance"…:27 TypeError: Cannot convert object to primitive value
    at new Error (native)
    at Client.trackException (/Applications/Visual Studio Code.app/Contents/Resources/app/node_modules/applicationinsights/Library/Client.js:67:25)
    at e.log (file:////Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:90:22274)
    at t.handleEvent (file:////Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:45:31955)
    at t.e.publicLog (file:////Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:45:29133)
    at t.e.flushErrorBuffer (file:////Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:45:27142)
    at file:////Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:45:27002onError @ index.html?config={"pathArguments"%3A[]%2C"programStart"%3A0%2C"workers"%3A-1%2C"enablePerformance"…:27(anonymous function) @ index.html?config={"pathArguments"%3A[]%2C"programStart"%3A0%2C"workers"%3A-1%2C"enablePerformance"…:96emitOne @ events.js:77emit @ events.js:169window.onerror @ /Applications/Visual Studio Code.app/Contents/Resources/atom.asar/renderer/lib/init.js:70t @ workbench.main.js:45
/Applications/Visual Studio Code.app/Contents/Resources/app/node_modules/applicationinsights/Librar…:67 Uncaught TypeError: Cannot convert object to primitive value

My project in question is open source and you can check it out. This file, Game.js is the only file I have open as you can see in the sidebar:

screen shot 2016-01-18 at 11 09 09 am

@egamma
Copy link
Member

egamma commented Jan 18, 2016

@delvarworld having access to the source code is great.

However, I wasn't yet able to reproduce your issues on OS X or Win see the gif below.

@jrieken any additional insights from the stack trace?

bug2054

@egamma
Copy link
Member

egamma commented Jan 18, 2016

This the refactoring scenario from #1991

bug2054-2

@AndrewRayCode
Copy link
Author

It tells me I'm up to date...

Version 0.10.6 (0.10.6)

Does visual studio code do any sort of caching of the project?

I guess you could try an npm install too in the project root?

@egamma
Copy link
Member

egamma commented Jan 18, 2016

Yes 0.10.6 is the latest and the version I've used (in addition to the latest).

Does visual studio code do any sort of caching of the project?

Code only caches the UI state (last opened file).

Running npm install is a good suggestion (I was assuming node_modules are excluded in jsconfig.json), but it is a difference. I currently run into npm timeouts I'll try again later.

@egamma egamma removed the info-needed Issue requires more information from poster label Jan 19, 2016
@egamma
Copy link
Member

egamma commented Jan 19, 2016

npm was in better shape today and I could run npm install.

After the npm install I can reproduce the crash:

  • start code
  • open src/containers/Game/game.js.

Here is a work around. Move the jsconfig.json into the src folder. The jsconfig.json file defines the root of a JS project and you can have more than one project context inside a workspace. I don't understand your source structure well enough yet, whether there should be another jsconfig.json inside another folder.

There is still a bug. I speculate that a top-level JS file refers to as JS file in a node module which results in a loop in the import graph, that makes the ImportAndExportRewriter recurse. We will replace the entire JS infrastructure with Salsa (see microsoft/TypeScript#4789) (preview Jan, default Feb). We will investigate whether it is worthwhile to fix this issue in the soon to be deprecated code base.

We will add more guidance on where to put the jsconfig.json to the doc (microsoft/vscode-docs#119).

On a topic unrelated to this issue. I notice, that you do not add any typings files *.d.ts files to get Intellisense for libraries like React. This is documented here https://code.visualstudio.com/docs/languages/javascript#_intellisense-support.

@jrieken
Copy link
Member

jrieken commented Jan 19, 2016

It seems to recurse forever here /some-game/static/dist/main-9b9280d716fd487e103f.js@1096

@jrieken
Copy link
Member

jrieken commented Jan 19, 2016

The expression at that offset is so long and complex (~450.000 characters) that we shouldn't use recursion.

@jrieken jrieken assigned jrieken and unassigned egamma Jan 19, 2016
@jrieken jrieken added the bug Issue identified by VS Code Team member as probable bug label Jan 19, 2016
@jrieken
Copy link
Member

jrieken commented Jan 19, 2016

I can make the ImportExportRewriter not use recursion anymore (while-loop ftw) but then the TypeScript compiler runs into the same issue during type binding. Once we have adopted project Salsa it will be good again because in recent version of TS this is fixed.

@delvarworld A different workaround is to also exclude static/dist from jsconfig.json.

@jrieken jrieken added the upstream Issue identified as 'upstream' component related (exists outside of VS Code) label Jan 19, 2016
@AndrewRayCode
Copy link
Author

Thanks @jrieken and @egamma, adding static/dist to ignore looks like it gives me a little bit of intellisense, however...

Because most of my files use the ES7 spread operator, it now thinks that my entire file is in error. Unfortunately, every time I find a workaround to a show-stopping bug in vscode (of which there have been many), I hit another. I can no longer afford time contributing to this project. Good luck!

@egamma
Copy link
Member

egamma commented Jan 20, 2016

@delvarworld thanks for joining our journey up to now. We got some really good insights from your project and we will continue to use it as a test case.

Just FYI, the ES7 spread operator, it is on the Typescript roadmap for TS 2.0.

Good luck to you as well.

@jrieken
Copy link
Member

jrieken commented Jul 13, 2016

closing as we track JS related issues in the TypeScript land

@jrieken jrieken closed this as completed Jul 13, 2016
@aeschli aeschli removed the bug Issue identified by VS Code Team member as probable bug label Sep 2, 2016
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
javascript JavaScript support issues upstream Issue identified as 'upstream' component related (exists outside of VS Code)
Projects
None yet
Development

No branches or pull requests

7 participants