microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.34k stars 28.9k forks source link

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

Closed PooLP closed 7 years ago

PooLP commented 7 years ago
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 commented 7 years ago

To help us investigate, can you please provide:

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

Thanks

Wosi commented 7 years ago

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 commented 7 years ago

New version of VSC, same error

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 commented 7 years ago

@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 https://github.com/Microsoft/TypeScript/issues/7469

PooLP commented 7 years ago

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

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

Thanks

mjbvz commented 7 years ago

Thank you for the follow up here @PooLP

I've opened a new TypeScript issue to track this: https://github.com/Microsoft/TypeScript/issues/13874

michaelsoriano commented 7 years ago

+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.