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

The TypeScript language service has suddenly stopped 5 times in the last 5 minutes. Consider opening a bug report. #19577

Closed
PooLP opened this issue Jan 30, 2017 · 7 comments
Assignees
Labels
javascript JavaScript support issues upstream Issue identified as 'upstream' component related (exists outside of VS Code)

Comments

@PooLP
Copy link

PooLP commented Jan 30, 2017

  • VSCode Version: Code - Insiders 1.9.0-insider (e68cede, 2017-01-27T20:44:13.107Z)
  • OS Version: Windows_NT ia32 10.0.14393
  • Extensions:
Extension Author Version
vs-code-css-comments ashhitch 1.0.2
jshint dbaeumer 0.10.15
vscode-eslint dbaeumer 1.2.2
beautify HookyQR 0.7.3
HTMLHint mkaufman 0.3.3
vscode-autoprefixer mrmlnc 2.0.0
typescript-javascript-grammar ms-vscode 0.0.17
ejs-language-support QassimFarid 0.0.1
stylelint shinnn 0.21.2
vs-code-office-ui-fabric sivarajanraju 0.1.7
JavaScriptSnippets xabikos 1.2.0

Steps to Reproduce:

  1. just open simple JS file
@mjbvz mjbvz self-assigned this Jan 30, 2017
@mjbvz mjbvz added javascript JavaScript support issues info-needed Issue requires more information from poster labels Jan 30, 2017
@mjbvz
Copy link
Collaborator

mjbvz commented Jan 30, 2017

To help us investigate, can you please provide:

  • The js file that causes this error
  • Any workspace or user settings you have.
  • What the rest of the workspace looks like. Do you have a jsconfig.json file?
  • Add "typescript.tsserver.trace": "verbose" to your settings and then restart vscode. Reproduce the issue and go to the "TypeScript" section of the output window and provide the output from there.

Also please try running code with extensions disabled to help pinpoint the root cause: code --disable-extensions

Thanks

@Wosi
Copy link

Wosi commented Jan 30, 2017

I faced also random stops of different language servers (TypeScript and OmniPascal) with the latest insiders build today. I was unable to gather any useful data about it. The same extensions work fine in the current stable release.

@PooLP
Copy link
Author

PooLP commented Jan 31, 2017

New version of VSC, same error

  • VSCode Version: Code - Insiders 1.9.0-insider (fcac9b6, 2017-01-31T00:57:46.157Z)
  • OS Version: Windows_NT ia32 10.0.14393
  • Extensions:
Extension Author Version
vs-code-css-comments ashhitch 1.0.2
jshint dbaeumer 0.10.15
vscode-eslint dbaeumer 1.2.2
beautify HookyQR 0.7.3
HTMLHint mkaufman 0.3.3
vscode-autoprefixer mrmlnc 2.0.0
typescript-javascript-grammar ms-vscode 0.0.17
ejs-language-support QassimFarid 0.0.1
stylelint shinnn 0.21.2
vs-code-office-ui-fabric sivarajanraju 0.1.7
JavaScriptSnippets xabikos 1.2.0

The js file that causes this error :
A simple JS file (same : JS Display Template

Any workspace or user settings you have. :

I have only User settings

// Placez vos paramètres dans ce fichier pour remplacer les paramètres par défaut
{
    //-------- Workbench configuration --------

    // Controls if opened editors should show in tabs or not.
    "editor.renderIndentGuides": true,

    // Configurez les associations entre les fichiers et les langages (par exemple, "*.extension": "html"). Celles-ci ont priorité sur les associations par défaut des langages installés.
    "files.associations": {
        "*.master": "html"
    },

    // eslint
    "eslint.enable": true,

    // styleint
    "stylelint.enable": true,
    "css.validate": true,

    // htmlint
    "htmlhint.enable": true,

    // CSS autoprefixer
    "autoprefixer.formatOnSave": true,

    // Beautufy
    "beautify.language": {
        "indent_size": 1,
        "indent_char": "    ",
        "css": {
            "indent_size": 2
        }
    }
,
"editor.wordWrap": true
}

What the rest of the workspace looks like. Do you have a jsconfig.json file?
No jsconfig.json or tsconfig.json

Add "typescript.tsserver.trace": "verbose" to your settings and then restart vscode. Reproduce the issue and go to the "TypeScript" section of the output window and provide the output from there.

[Trace - 08:24:09] Sending request: geterr (156). Response expected: no. Current queue length: 0
Arguments: {
    "delay": 0,
    "files": []
}
[Trace - 08:24:09] Sending request: geterr (157). Response expected: no. Current queue length: 0
Arguments: {
    "delay": 0,
    "files": [
        "p:/_catalogs/masterpage/Display Templates/NewArrivals/Control_NewArrivals.js"
    ]
}
[Error - 08:24:09] TSServer exited with code: 3221226356
[Info  - 08:24:09] Using tsserver from location: c:\Program Files (x86)\Microsoft VS Code Insiders\resources\app\extensions\typescript\node_modules\typescript\lib\tsserver.js
[Trace - 08:24:09] Sending request: configure (158). Response expected: yes. Current queue length: 0
Arguments: {
    "hostInfo": "vscode"
}
[Trace - 08:24:10] Response received: configure (158). Request took 190 ms. Success: true 
[Trace - 08:24:10] Sending request: compilerOptionsForInferredProjects (159). Response expected: yes. Current queue length: 1
Arguments: {
    "options": {
        "module": "CommonJS",
        "target": "ES6",
        "allowSyntheticDefaultImports": true,
        "allowNonTsExtensions": true,
        "allowJs": true,
        "jsx": "Preserve"
    }
}
[Trace - 08:24:10] Response received: compilerOptionsForInferredProjects (159). Request took 191 ms. Success: true 
Result: true
[Trace - 08:24:10] Sending request: open (160). Response expected: no. Current queue length: 0
Arguments: {
    "file": "p:/_catalogs/masterpage/Display Templates/NewArrivals/Control_NewArrivals.js",
    "fileContent": "(function () {\r\n\r\n    // Config contains variables that are defined in one place\r\n    var config = {\r\n        /* IMPORTANT: update these settings before uploading the file to the master page gallery */\r\n        template: 'Control_NewArrivals.js'\r\n    };\r\n    var templateUrl;\r\n\r\n    var register = function () {\r\n        if (\"undefined\" !== typeof (Srch) && \"undefined\" !== typeof (Srch.U) && typeof (Srch.U.registerRenderTemplateByName) === \"function\") {\r\n            Srch.U.registerRenderTemplateByName(templateUrl, render);\r\n\r\n            //Localization\r\n            var localizationUrl = '~sitecollection' + scriptUrl.substr(scriptUrl.indexOf('/_catalogs/'));\r\n            $includeLanguageScript(localizationUrl, \"~sitecollection/_catalogs/masterpage/Display Templates/NewArrivals/Resources.{Locale}.js\");\r\n\r\n        }\r\n    },\r\n\t\trender = function (ctx) {\r\n\t\t    // Display template data\r\n\t\t    var cachePreviousTemplateData = ctx.DisplayTemplateData;\r\n\t\t    ctx.DisplayTemplateData = {\r\n\t\t        'TemplateUrl': templateUrl,\r\n\t\t        'TemplateType': 'Control',\r\n\t\t        'TargetControlType': ['SearchResults', 'Content Web Parts']\r\n\t\t    };\r\n\r\n\t\t    // Checks to see if the client control loaded correctly\r\n\t\t    if (!$isNull(ctx.ClientControl) && !$isNull(ctx.ClientControl.shouldRenderControl) && !ctx.ClientControl.shouldRenderControl()) {\r\n\t\t        return \"\";\r\n\t\t    }\r\n\r\n\t\t    ctx.ListDataJSONGroupsKey = \"ResultTables\";\r\n\r\n            // Slider initialisation\r\n            AddPostRenderCallback(ctx, function () {\r\n\r\n                /* Slider */\r\n                var sliderNewArrivalsBx;\r\n                var $sliderNewArrivalsContainer = jQuery('.newarrivals-slider');\r\n                var slideNewsWidth = $sliderNewArrivalsContainer.width();\r\n                var sliderNewArrivalsConfig;\r\n\r\n                function getConfig(width) {\r\n                    return {\r\n                        mode: 'fade',\r\n                        pager: true,\r\n                        autoHover: true,\r\n                        infiniteLoop: true,\r\n                        auto: true,\r\n                        autoStart: true,\r\n                        speed: 500,\r\n                        pause: 3000,\r\n                        easing: 'swing',\r\n                        pagerCustom: '#bxPagerBubble',\r\n                        nextSelector: '#sliderNext',\r\n                        prevSelector: '#sliderPrev',\r\n                        nextText: 'Suivant',\r\n                        prevText: 'Précédent',\r\n                        slideWidth: width,\r\n                        slideSelector: '.newArrivals-slider-item'\r\n                    };\r\n                }\r\n\r\n                function sliderNewArrivals(reload) {\r\n                    //if (Modernizr.mq(tabletSize)) sliderNewArrivalsContainer = jQuery(window);\r\n\r\n                    sliderNewArrivalsWidth = $sliderNewArrivalsContainer.width();\r\n\r\n                    sliderNewArrivalsConfig = getConfig(sliderNewArrivalsWidth);\r\n\r\n                    if (!reload) {\r\n                        sliderNewArrivalsBx = jQuery('#newArrivalsSlider .ms-srch-group-content').bxSlider(sliderNewArrivalsConfig);\r\n                    } else {\r\n                        /* debug pour la méthode reloadSlider sur IOS et le bouton de Maximisation des fenêtres des navigateur windows */\r\n                        setTimeout(function () {\r\n\r\n                            var sliderNewArrivalsNewWidth = $sliderNewArrivalsContainer.width();\r\n                            var reloadedConfig = getConfig(sliderNewArrivalsNewWidth);\r\n                            sliderNewArrivalsBx.reloadSlider(reloadedConfig);\r\n                        }, 100);\r\n                    }\r\n                }\r\n\r\n                function sliderNewArrivalsResize() {\r\n                    sliderNewArrivals(false);\r\n                    jQuery(window).on(\"orientationchange resize\", function () {\r\n                        sliderNewArrivals(true);\r\n                    });\r\n                }\r\n\r\n                if (ExecuteOrDelayUntilScriptLoaded && _spBodyOnLoadFunctionNames) {\r\n                    sliderNewArrivalsResize();\r\n                }\r\n            });\r\n\r\n            // Pager\r\n            var numResults = ctx.ListData.ResultTables[0].RowCount;\r\n            var sliderPagertitle;\r\n            var sliderPager = '';\r\n\r\n            if (numResults > 1) {\r\n                for (var i = 0; i < numResults; i++) {\r\n                    sliderPagertitle = ctx.ListData.ResultTables[0].ResultRows[i].Title\r\n                    sliderPager += String.format('<a data-slide-index=\"{0}\" class=\"bx-pager-lnk\"><span class=\"bx-pager-lbl\">{1}</span></a>', i, sliderPagertitle);\r\n                }\r\n            }\r\n\r\n            // START : Check if the web part should be hidden (when no results are retrieved)\r\n\t\t    var currentQueryState = ctx.DataProvider.get_totalRows() === 0;\r\n\t\t    if (ctx.ClientControl.get_shouldShowNoResultMessage() && currentQueryState) {\r\n\t\t        var containerClass = $htmlEncode(ctx.ClientControl.get_nextUniqueId() + \"_hide\");\r\n\t\t        AddPostRenderCallback(ctx, function () {\r\n\t\t            // Check if page is in edit mode\r\n\t\t            var inDesignMode = document.forms[MSOWebPartPageFormName].MSOLayout_InDesignMode;\r\n\t\t            var wikiInEditMode = document.forms[MSOWebPartPageFormName]._wikiPageMode;\r\n\t\t            var inEdit = false;\r\n\t\t            if (typeof inDesignMode !== \"undefined\") {\r\n\t\t                inEdit = inDesignMode.value === \"1\" ? true : false;\r\n\t\t            }\r\n\t\t            if (typeof wikiInEditMode !== \"undefined\") {\r\n\t\t                inEdit = wikiInEditMode.value === \"Edit\" ? true : false;\r\n\t\t            }\r\n\t\t            // Hide the webpart when page is not in edit mode\r\n\t\t            if (!inEdit) {\r\n\t\t                var container = document.getElementsByClassName(containerClass);\r\n\t\t                if (container.length) {\r\n\t\t                    var elm = container[0];\r\n\t\t                    while ((elm = elm.parentElement) && !elm.classList.contains('s4-wpcell-plain'));\r\n\t\t                    if (typeof elm !== \"undefined\" && elm !== null) {\r\n\t\t                        elm.style.display = \"none\";\r\n\t\t                    }\r\n\t\t                }\r\n\t\t            }\r\n\t\t        });\r\n\t\t    }\r\n\t\t    // END : Check if the web part should be hidden (when no results are retrieved)\r\n\r\n\t\t    // HTML markup for the control template\r\n            var htmlMarkup = String.format(\r\n                '<section class=\"{0} newarrivals-slider\">\\\r\n                    <h1 class=\"newarrivals-slider-title\">' + $resource('newArrivalsTitle') + '</h1>\\\r\n                    <div id=\"newArrivalsSlider\" class=\"newarrivals-slider-slides\">{1}</div>\\\r\n                        <footer class=\"newarrivals-slider-footer\">\\\r\n                            <div id=\"sliderPrev\" class=\"slider-prev\"></div>\\\r\n                            <div id=\"sliderNext\" class=\"slider-next\"></div>\\\r\n                            <div id=\"bxPagerBubble\" class=\"bx-pager\">{2}</div>\\\r\n                        </footer>\\\r\n                    </div>\\\r\n                </section>', containerClass, ctx.RenderGroups(ctx), sliderPager);\r\n\r\n\t\t    // Caching\r\n\t\t    ctx.DisplayTemplateData = cachePreviousTemplateData;\r\n\r\n\t\t    // Return the HTML markup\r\n\t\t    return htmlMarkup;\r\n\t\t};\r\n\r\n    /* DO NOT REMOVE THE FOLLOWING LINES OF CODE */\r\n    // MDS needs to start on the head\r\n    // Retrieve all the loaded scripts\r\n    var allScripts = document.head.getElementsByTagName(\"script\");\r\n    var scriptUrl = null;\r\n    var scriptNr = allScripts.length;\r\n    while (scriptNr--) {\r\n        var crntScript = allScripts[scriptNr];\r\n        if (crntScript.src !== null) {\r\n            // Check if the right script is retrieved based on the filename of the template\r\n            if (crntScript.src.indexOf('/_catalogs/') > 0 && crntScript.src.toLowerCase().indexOf(config.template.toLowerCase()) > 0) {\r\n                scriptUrl = crntScript.src;\r\n                break;\r\n            }\r\n        }\r\n    }\r\n    if (scriptUrl !== null) {\r\n        // Remove the query string \r\n        if (scriptUrl.indexOf('?') > 0) {\r\n            scriptUrl = scriptUrl.split(\"?\")[0];\r\n        }\r\n        // Insert the site collection token\r\n        templateUrl = '~sitecollection' + scriptUrl.substr(scriptUrl.indexOf('/_catalogs/'));\r\n        templateUrl = decodeURI(templateUrl);\r\n        // Register the template to load\r\n        register();\r\n        if (typeof (RegisterModuleInit) === \"function\" && typeof (Srch.U.replaceUrlTokens) === \"function\") {\r\n            RegisterModuleInit(Srch.U.replaceUrlTokens(templateUrl), register);\r\n        }\r\n    }\r\n})();"
}

Thanks

@egamma
Copy link
Member

egamma commented Jan 31, 2017

@PooLP it looks like your run the JS file on a Sharepoint volume? Can you reproduce this when you run the same .js file on a local file system.

This reminds me of this issue microsoft/TypeScript#7469

@PooLP
Copy link
Author

PooLP commented Jan 31, 2017

Yes a mapped drive access ... I don't have this problem with local file.

It looks like of issue (microsoft/TypeScript#7469)

Thanks

@mjbvz mjbvz added upstream Issue identified as 'upstream' component related (exists outside of VS Code) and removed info-needed Issue requires more information from poster labels Feb 3, 2017
@mjbvz
Copy link
Collaborator

mjbvz commented Feb 3, 2017

Thank you for the follow up here @PooLP

I've opened a new TypeScript issue to track this: microsoft/TypeScript#13874

@mjbvz mjbvz closed this as completed Feb 3, 2017
@michaelsoriano
Copy link

+1 here. Files are in SharePoint 2013 folder. I was trying to follow thread - I updated to the latest VSC - but still get the warn.

@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

6 participants