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

TypeScript language service crashes on projects on a mounted SharePoint WebDav folder #7469

Closed
egamma opened this issue Mar 10, 2016 · 23 comments
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue

Comments

@egamma
Copy link
Member

egamma commented Mar 10, 2016

From @jandersonfcosta on March 8, 2016 15:31

After update VSC to 0.10.10, javascript intellisense stop working.

VSC show warn message: "The Typescript language service died unexpectedly 5 times in the last 5 Minutes. Please consider to open a bug report."

Any idea?
Thank you!

Copied from original issue: microsoft/vscode#3860

@egamma egamma self-assigned this Mar 10, 2016
@egamma
Copy link
Member Author

egamma commented Mar 10, 2016

Can you provide some more information about your project setup, what kind of project? What is your jsconfig.json? What libraries are you using.

@egamma
Copy link
Member Author

egamma commented Mar 10, 2016

From @jandersonfcosta on March 8, 2016 15:56

Hi egamma,
The project folder containing the js files are in the SharePoint database.
SharePoint is installed on my test server.
I open project files via SharePoint WEBDAV protocol in VSC.

Note: For css, js and html files, intellisense is working normal.

So intellisense is lost.

Before it worked.

@egamma
Copy link
Member Author

egamma commented Mar 10, 2016

I suspect you run out of memory because you do not exclude some of the folders in the project in the jsconfig.json.

Therefore Does your project include a jsconfig.json? If yes, can you include it?

If it doesn't have a jsconfig.json, can you create one following the migration guide:
https://code.visualstudio.com/Updates#_languages-javascript section Migration guide.

In the past Code excluded some folders automatically, this is not done automatically anymore and you need to define the exclude folders in the jsconfig.json.

@egamma
Copy link
Member Author

egamma commented Mar 10, 2016

From @jandersonfcosta on March 8, 2016 17:7

My project not include a jsconfig.json
I do not know what the role of js config.json..

Note: For css, json and html files, intellisense is working normal.
Intellisense not work only for js files.

@egamma
Copy link
Member Author

egamma commented Mar 10, 2016

JavaScript is more complex than css, html, and json, therefore a complex project needs a jsconfig.json. In the past we have automatically excluded some folders from being analyzed we no longer do this and for this reason you now need a jsconfig.json file.

I do not know what the role of js config.json.

jsconfig.json is documented here https://code.visualstudio.com/docs/languages/javascript#_javascript-projects-jsconfigjson

@egamma
Copy link
Member Author

egamma commented Mar 10, 2016

From @jandersonfcosta on March 8, 2016 17:41

Did not work

@egamma
Copy link
Member Author

egamma commented Mar 10, 2016

Can you pls sketch the folder structure (as is done here microsoft/vscode#3791 (comment)) of your project and include the jsconfig.json you are using? Without some more information we cannot track this down.

@egamma
Copy link
Member Author

egamma commented Mar 10, 2016

From @lukkarip on March 10, 2016 8:8

The workflow to work with SharePoint Javascript, CSS, MasterPage, PageLayouts etc. is to map folder [site]/_catalogs/masterpage and work with this mapped folder. The problem is that by default you can't include json files (http://sharepoint.stackexchange.com/questions/114540/why-is-upload-of-json-files-prohibited) :)

So way to work with Visual Studio Code is to reference Typescript definitions by adding references to code pages "manually". So, after Visual Studio Code 0.10.10 update, opening any javascript file now gives error "The Typescript language service died unexpectedly 5 times in the last 5 Minutes. Please consider to open a bug report." again and again.

@egamma
Copy link
Member Author

egamma commented Mar 10, 2016

@lukkarip thanks for explaining the workflow and setup.

I assume this is a larger folder with many JS files? Previously, the JavaScript infrastructure has excluded some well known folders: node_modules, bower_components, jspm_packages, tmp, and temp. So if these folders have many JS files and you cannot exclude them then this can explain the crash.

Can you confirm that this is the case. I'm sorry that adding a jsconfig.json is not a solution for your setup.

@egamma
Copy link
Member Author

egamma commented Mar 10, 2016

From @lukkarip on March 10, 2016 9:42

I made a quick test to demonstrate the problem. I created just one javascript file, which contains no reference to anything, just couple of lines some javascript. I put this one file in "testing" folder under [site]/_catalogs/masterpage. This is done by mapping network drive (WebDAV). This is SharePoint 2013.

In Visual Studio Code (0.10.10) I select only to open this "testing" folder with one js file. When opened Visual Studio Code starts to give warning "The Typescript language service died unexpectedly 5 times in the last 5 Minutes. Please consider to open a bug report." again and again.

So in practise, Visual Studio Code cannot be used with SharePoint 2013 at the moment. Needed to change to SublimeText for now. Hope some fix is goming soon.

I have admin rights so seems that I was able to .json-format from "not allowed files" in SharePoint Central Admin. With this change. I can in fact add json-file. The problem is in this my test case there seems to be anything that could be excluded(?)

@egamma
Copy link
Member Author

egamma commented Mar 10, 2016

Can you reproduce this when you work on a local folder with the same file?

@egamma
Copy link
Member Author

egamma commented Mar 10, 2016

Can you share this one js file?

@egamma
Copy link
Member Author

egamma commented Mar 10, 2016

From @lukkarip on March 10, 2016 10:14

Same "testing"-folder with this one file works fine locally. The problem is only if opened in SharePoint 2013 mapped folder. Test file is really uninteresting random javascript, but here it is: https://github.com/lukkarip/Tests/blob/master/testing/session-handler.js

@egamma
Copy link
Member Author

egamma commented Mar 10, 2016

@bpasero can you please add your insights on the node issue that causes this and then move it to the TypeScript repository.

@egamma
Copy link
Member Author

egamma commented Mar 10, 2016

From @bpasero on March 10, 2016 17:18

The node issue is: nodejs/node#4002

@egamma I am not sure how to move the issue, so I give it back to you to decide if this one should stay open as tracking bug or not.

@egamma
Copy link
Member Author

egamma commented Mar 10, 2016

From @bpasero on March 10, 2016 17:19

And our workaround for the bug is in: https://github.com/Microsoft/vscode/blob/master/src/vs/base/node/extfs.ts#L48

@egamma
Copy link
Member Author

egamma commented Mar 10, 2016

@bpasero thanks.

This is a regression for SharePoint users using code. The previous JS implementation profited from the fix described above. Therefore suggest to consider it for TS 1.8.9 if possible.

@billti
Copy link
Member

billti commented Mar 10, 2016

This could also be related to #7420 , where file watchers cause issues if not a local drive.

@mhegazy mhegazy assigned zhengbli and unassigned egamma Mar 10, 2016
@mhegazy mhegazy added the Bug A bug in TypeScript label Mar 10, 2016
@zhengbli
Copy link
Contributor

@jandersonfcosta The fix was merged in master, can you confirm it with your project? You can clone master and build locally, or wait for a day to use the next nightly build on npm (at least version "[email protected]")

@zhengbli
Copy link
Contributor

With the latest change of returning polling file watchers, this should be fixed.

@zhengbli zhengbli added the Fixed A PR has been merged for this issue label Apr 25, 2016
@cverhelst
Copy link

This started reoccuring for me on the most recent vs code update. WebDav on SharePoint. We see it's traversing the webdav folder for tsconfig.json & jsconfig.json while issuing a warning in the editor that the TypeScript language service has crashed 5 times in the last 5 seconds.

@mhegazy
Copy link
Contributor

mhegazy commented Dec 19, 2016

@cverhelst can you please log a new issue and give us more information about which versions you are using and a repro project that can help us diagnose the issue.

@cverhelst
Copy link

@mhegazy It's fixed in the latest patch, thanks! microsoft/vscode#17345

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

5 participants