Skip to content

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

Closed

Description

See GIF again:

vs-code-why

Literally none of the editor features work.

My jsconfig.json:

{
    "compilerOptions": {
        "target": "ES6",
        "module": "commonjs"
    },
    "exclude": [
        "node_modules"
    ]
}

Activity

  1. okian commented on Jan 16, 2016

    @okian

    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?

  2. AndrewRayCode commented on Jan 16, 2016

    @AndrewRayCode
    Author

    I use LiceCap

  3. felixfbecker commented on Jan 17, 2016

    @felixfbecker
    Contributor

    @moostad I can recommend ScreenToGif :)

  4. egamma commented on Jan 18, 2016

    @egamma
    Member

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

  5. egamma commented on Jan 18, 2016

    @egamma
    Member

    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

  6. added
    info-needed
    on Jan 18, 2016
  7. AndrewRayCode commented on Jan 18, 2016

    @AndrewRayCode
    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

  8. egamma commented on Jan 18, 2016

    @egamma
    Member

    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.

    Johannes Rieken (@jrieken) any additional insights from the stack trace?

    bug2054

  9. egamma commented on Jan 18, 2016

    @egamma
    Member

    This the refactoring scenario from #1991

    bug2054-2

  10. AndrewRayCode commented on Jan 18, 2016

    @AndrewRayCode
    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?

  11. egamma commented on Jan 18, 2016

    @egamma
    Member

    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.

  12. removed
    info-needed
    on Jan 19, 2016
  13. egamma commented on Jan 19, 2016

    @egamma
    Member

    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.

  14. jrieken commented on Jan 19, 2016

    @jrieken
    Contributor

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

  15. jrieken commented on Jan 19, 2016

    @jrieken
    Contributor

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

  16. added
    bug
    on Jan 19, 2016
  17. jrieken commented on Jan 19, 2016

    @jrieken
    Contributor

    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.

  18. added
    upstream
    on Jan 19, 2016
  19. AndrewRayCode commented on Jan 19, 2016

    @AndrewRayCode
    Author

    Thanks Johannes Rieken (@jrieken) and Erich Gamma (@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!

  20. egamma commented on Jan 20, 2016

    @egamma
    Member

    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.

  21. jrieken commented on Jul 13, 2016

    @jrieken
    Contributor

    closing as we track JS related issues in the TypeScript land

  22. removed
    bug
    on Sep 2, 2016
  23. 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

javascriptupstream

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions