microsoft / nodejstools

Node.js Tools for Visual Studio
http://aka.ms/explorentvs
Apache License 2.0
1.79k stars 359 forks source link

VS 2015 Community with Node js tools 1.1 occassionally hangs or crashes VS #630

Closed jtobinisaniceguy closed 8 years ago

jtobinisaniceguy commented 8 years ago

Seems pretty random, sometimes it happens while debugging, others when only editing or both. VS seems to be unresponsive for a few seconds, then comes back into action, other times it just stops responding. Whatever I can do to help diagnose please ask.

Laro88 commented 8 years ago

Same here, sporadic and odd behavior. Node.JS upgraded to 5.2 - now got one project that can debug unit tests and one that crashes Besides this memory runaway / VS2015 using a full core and eating memory - but not is a consistent and reproducable way :-(

Debug of unit test crash

 The thread 'main thread' (0x1) has exited with code 0 (0x0).
The program '[1] node.exe @ tcp://localhost:50506/#ping=0' has exited with code -1 (0xffffffff).
theGrue commented 8 years ago

Same, but only happens on one of my projects out of a few.

jtobinisaniceguy commented 8 years ago

Got this from activity log: System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown. at Microsoft.NodejsTools.Analysis.AnalysisSetDetails.AnalysisHashSet.EnsureSize(Int32 newSize) at Microsoft.NodejsTools.Analysis.AnalysisSetDetails.AnalysisHashSet.CheckGrow() at Microsoft.NodejsTools.Analysis.AnalysisSetDetails.AnalysisHashSet.AddOne(AnalysisProxy key) at Microsoft.NodejsTools.Analysis.AnalysisSetDetails.AnalysisHashSet.Add(AnalysisProxy item, Boolean& wasChanged) at Microsoft.NodejsTools.Analysis.ModuleAnalysis.GetValuesByIndex(String exprText, Int32 index) at Microsoft.NodejsTools.Intellisense.ExpressionAnalysis.get_Values() at Microsoft.NodejsTools.Intellisense.QuickInfoSource.AugmentQuickInfoWorker(ExpressionAnalysis vars, IList1 quickInfoContent, ITrackingSpan& applicableToSpan) at Microsoft.NodejsTools.Intellisense.QuickInfoSource.AugmentQuickInfoSession(IQuickInfoSession session, IList1 quickInfoContent, ITrackingSpan& applicableToSpan) at Microsoft.VisualStudio.Language.Intellisense.Implementation.QuickInfoSession.Recalculate() at Microsoft.VisualStudio.Language.Intellisense.Implementation.QuickInfoSession.Start() at Microsoft.VisualStudio.Language.Intellisense.Implementation.QuickInfoBroker.TriggerQuickInfo(ITextView textView, ITrackingPoint triggerPoint, Boolean trackMouse) at Microsoft.NodejsTools.Intellisense.IntellisenseController.TextViewMouseHover(Object sender, MouseHoverEventArgs e) at Microsoft.VisualStudio.Text.Editor.Implementation.WpfTextView.RaiseHoverEvents()

Nodejs 5.2/Nodejstools 1.1/VS 2015 Community

kant2002 commented 8 years ago

@jtobinisaniceguy This is issue which is well-known. At least I know it ~half year. See #300 . Alternatively when NTVS team implement ideas from #488 we will likely see this issue. I have some idea how this could be fixed, but NTVS team is slow in working with community. If you interested in solution, I could try made some improvements.

@Laro88 Seems that you having different kind of issue with debugger. Could you provide more insight, maybe I could route you to appropriate issue which in this list?

Laro88 commented 8 years ago

@kant2002 IMHO the most difficult thing to develop is developer tools :-) since there are so many odd scenarios to address - broken pointers, circular references in memory structures. I "solved" by stepping back from 5.2 to 5.0. It may be related to 5.2 using 4.6.85.31 and 5.0 using 4.6.85.28 I was briefly looking for a way to enable some debugging in NTVS - perhaps a log output of the ongoing activity, but I haven't found the "NTVS developers guide to the galaxy yet." The npm subsystem at least on 3.3.6 as thas a strange behavior of not checking references of references - so you may end on having older versions in use that are not updated since they are not in package.json - which may be my actual problem. I am using Jade but it is unreferenced in package.json (I probably deleted it) but node is running fine without the reference - and Jade is not being updated. I am reporting this in npm as an issue in a couple of minutes.

kant2002 commented 8 years ago

@Laro88 Here the link how to build project. https://github.com/Microsoft/nodejstools/wiki/Build-Instructions From my experience it is pretty painless. You just have to uninstall installed NTVS, and your could debug without issues. Regarding V8 version, maybe you are right, So this information itself is good for filing new issue. There two kind of troubleshooting, generic one 'Tools -> Node JS tools -> Diagnostic info', and second one is related to Debugging specifically. You have to go to 'Tools -> Node JS tools -> Diagnostic info' and enable checkbox 'Enable Node.JS Tools Live Diagnostics output pane'. Enabling such diagnostics will create new entry in the Output Window where all traffic between Node.JS debugger and VS would be captured. When you have error, you have to copy all content of debugger output related to your last debug session. With that it give at least some insights for developers how to fix error. Hope this is at least guide to our local galaxy branch :smile:

kant2002 commented 8 years ago

@Laro88 See #638

billti commented 8 years ago

@jtobinisaniceguy @Laro88 Just to be clear, did you both have issues that were addressed by going back from Node 5.2 to an earlier release? Do you have any outstanding issues after moving back?

Obviously Node is a moving target, and 5.2 came out after we were done with 1.1. We'll try and keep up, but the 4.x line was the LTS when we shipped (and still is), so that's the most validated currently.

Laro88 commented 8 years ago

@billti It solved my crashes but I still have some locking on VS2015 and some issues with VS2015 eating memory. I agree that the target is moving and that it must be quite difficult to keep up :-)

rkavalap commented 8 years ago

I found a same error logged within eventviewer. At the time of error, I had VS 2015 opened System Install details VS 2015 Enterprise, VS 2013 Ultimate (I think) Node JS: 4.2.1 Typescript 1.8.4 NodeJS tools addon 1.1.311117.00 for VS 2015, 2013

Application: devenv.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.OutOfMemoryException at Microsoft.NodejsTools.Analysis.AnalysisSetDetails.AnalysisHashSet.EnsureSize(Int32) at Microsoft.NodejsTools.Analysis.AnalysisSetDetails.AnalysisHashSet.CheckGrow() at Microsoft.NodejsTools.Analysis.AnalysisSetDetails.AnalysisHashSet.AddOne(Microsoft.NodejsTools.Analysis.AnalysisProxy) at Microsoft.NodejsTools.Analysis.AnalysisSetDetails.AnalysisHashSet.Union(System.Collections.Generic.IEnumerable1<Microsoft.NodejsTools.Analysis.AnalysisProxy>, Boolean ByRef) at Microsoft.NodejsTools.Analysis.AnalysisSet.AsUnion(Microsoft.NodejsTools.Analysis.IAnalysisSet, Microsoft.NodejsTools.Analysis.UnionComparer, Boolean ByRef) at Microsoft.NodejsTools.Analysis.AnalysisSet.AsUnion(Microsoft.NodejsTools.Analysis.IAnalysisSet, Int32, Boolean ByRef) at Microsoft.NodejsTools.Analysis.AnalysisSet.AsStrongerUnion(Microsoft.NodejsTools.Analysis.IAnalysisSet) at Microsoft.NodejsTools.Analysis.Analyzer.DependentKeyValue.AddTypes(Microsoft.NodejsTools.Analysis.ProjectEntry, Microsoft.NodejsTools.Analysis.JsAnalyzer, Microsoft.NodejsTools.Analysis.IAnalysisSet, Microsoft.NodejsTools.Analysis.IAnalysisSet, Boolean) at Microsoft.NodejsTools.Analysis.Values.ExpandoValue.SetIndex(Microsoft.NodejsTools.Parsing.Node, Microsoft.NodejsTools.Analysis.AnalysisUnit, Microsoft.NodejsTools.Analysis.IAnalysisSet, Microsoft.NodejsTools.Analysis.IAnalysisSet) at Microsoft.NodejsTools.Analysis.AnalysisSetExtensions.SetIndex(Microsoft.NodejsTools.Analysis.IAnalysisSet, Microsoft.NodejsTools.Parsing.Node, Microsoft.NodejsTools.Analysis.AnalysisUnit, Microsoft.NodejsTools.Analysis.IAnalysisSet, Microsoft.NodejsTools.Analysis.IAnalysisSet) at Microsoft.NodejsTools.Analysis.Analyzer.ExpressionEvaluator.AssignTo(Microsoft.NodejsTools.Parsing.Node, Microsoft.NodejsTools.Parsing.Expression, Microsoft.NodejsTools.Analysis.IAnalysisSet) at Microsoft.NodejsTools.Analysis.Analyzer.ExpressionEvaluator.EvaluateBinary(Microsoft.NodejsTools.Analysis.Analyzer.ExpressionEvaluator, Microsoft.NodejsTools.Parsing.Node) at Microsoft.NodejsTools.Analysis.Analyzer.ExpressionEvaluator.EvaluateWorker(Microsoft.NodejsTools.Parsing.Node) at Microsoft.NodejsTools.Analysis.Analyzer.DDG.Walk(Microsoft.NodejsTools.Parsing.ExpressionStatement) at Microsoft.NodejsTools.Parsing.ExpressionStatement.Walk(Microsoft.NodejsTools.Parsing.AstVisitor) at Microsoft.NodejsTools.Analysis.Analyzer.DDG.Walk(Microsoft.NodejsTools.Parsing.Block) at Microsoft.NodejsTools.Parsing.Block.Walk(Microsoft.NodejsTools.Parsing.AstVisitor) at Microsoft.NodejsTools.Analysis.Analyzer.DDG.Walk(Microsoft.NodejsTools.Parsing.IfNode) at Microsoft.NodejsTools.Parsing.IfNode.Walk(Microsoft.NodejsTools.Parsing.AstVisitor) at Microsoft.NodejsTools.Analysis.Analyzer.DDG.Walk(Microsoft.NodejsTools.Parsing.Block) at Microsoft.NodejsTools.Parsing.Block.Walk(Microsoft.NodejsTools.Parsing.AstVisitor) at Microsoft.NodejsTools.Analysis.Analyzer.DDG.Walk(Microsoft.NodejsTools.Parsing.WhileNode) at Microsoft.NodejsTools.Parsing.WhileNode.Walk(Microsoft.NodejsTools.Parsing.AstVisitor) at Microsoft.NodejsTools.Analysis.Analyzer.DDG.Walk(Microsoft.NodejsTools.Parsing.Block) at Microsoft.NodejsTools.Parsing.Block.Walk(Microsoft.NodejsTools.Parsing.AstVisitor) at Microsoft.NodejsTools.Analysis.Analyzer.FunctionAnalysisUnit.AnalyzeWorker(Microsoft.NodejsTools.Analysis.Analyzer.DDG, System.Threading.CancellationToken) at Microsoft.NodejsTools.Analysis.Analyzer.DDG.Analyze(Microsoft.NodejsTools.Analysis.Deque1, System.Threading.CancellationToken) at Microsoft.NodejsTools.Analysis.JsAnalyzer.AnalyzeQueuedEntries(System.Threading.CancellationToken) at Microsoft.NodejsTools.Intellisense.VsProjectAnalyzer+AnalysisQueue+GroupAnalysis.Analyze(System.Threading.CancellationToken) at Microsoft.NodejsTools.Intellisense.VsProjectAnalyzer+AnalysisQueue.Worker(System.Object) at System.Threading.ThreadHelper.ThreadStart_Context(System.Object) at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) at System.Threading.ThreadHelper.ThreadStart(System.Object)

DenisBiondic commented 8 years ago

The issue for me with exact OutOfMemoryException was analysis running over too many node modules. Either turn of analysis completely (visual studio tools / options / text editor / node / intellisense) or ignore the big folders for analysis like written here: https://github.com/Microsoft/nodejstools/wiki/Projects#ignoring-directories-for-analysis

bofcarbon1 commented 8 years ago

I guess I should look into upgrading from VS 2013 Community to VS 2015 Community to start. In VS 2013 I am using the NodeJS extension and using meanJS, grunt, bower and the kitchen sink to build the MEAN stack app structure. There are just so many dependencies going on with these apps and I see a ton of warnings about updating to the current version of a dozen or so scripts. It just all seems too top heavy for its purpose which was to get a more streamlined fast running client side app up and running.

My experiences with NodeJs so far have been negative. The idea of the MongoDB with mongoose is uncomfortable in the first place. BSON like files and mongoose is resolving the connection and interfaces with the server models. Then introduce Express into the picture for handing API service requests and there is a lot that can go wrong.

I'm for AngularJS but just building a simple SPA app and using ASP.NET Web API services was reliable, easy and IDE friendly. I'm wondering what the benefit of using MEAN Stack is if I can't use an established IDE like VS without it going into 'Not Responding' mode every time I make a change in my app.

punmechanic commented 8 years ago

@bofcarbon1 VS being crap with JS is not the MEAN stack's fault. The MEAN stack works perfectly fine in Sublime, it's the dev tools that have the issue.

The NodeJS dev tools simply need to do less analysing of packages. There can be quite a few and on slower HDDs it's too slow.

bofcarbon1 commented 8 years ago

@danpantry Rather than stare at VS 'Not Responding' I decided to go with Cloud 9. I researched for a while and narrowed it down to 3 (Cloud 9, Sublime and Intellij). I like the idea of the github connection, cloud based approach and it was in my budget (free) and I already started using repositories in github.

I am moving the MEAN stack tutorial app out of VS and into the cloud. Right off the bat the browser simulation interested me. I had a recent interview and the owner of the company asked me if I owned a Mac. I realized that I'd be having to test for many browsers since I'd be the only IT guy. Looking the the browser simulator with operating system choice I realized how valuable that option was. I am at the 'fresher' level with MEAN so my frustration is mostly from the comfort level I had with VS and the surprisingly vast number of script dependencies on the server side.

First MEAN Stack NodeJS tutorial I used suggested all of these 'npm' commands to build and scaffold the project structure. You end up with a long list of dependencies and library structures that are pretty unforgiving if you want to restructure the project folders. The 'npm' generator asks you to specify the application you want to create but if you already created a solution and project in VS its not clear whether 'npm' is going to build the configuration and associated scripts under the project folder. When I went to move everything up to one project level (VS thinking) it broke the references to the library structure 'npm' generated and there was way too much to resolve.

So I think going in a different direction with Nodejs on a tool more suited to it is the answer. Eventually I'll understand why a MEAN stack project requires 200 script files from 50 open source participants but that's another story. I will say that I am actually getting NodeJS to run now which is a huge breakthrough. Previously with an Apress book on AngularJS the exercises for using NodeJS would not work so I blew it off at that time. Eventually if you cut through enough brush you'll find the hiking trail.

punmechanic commented 8 years ago

@bofcarbon1 Because Node has lots of micropackages that do one thing - that's why there are 200 script files :) It's just the way we work - lots of small frameworks rather than monolithic ones

TbLtzk commented 8 years ago

I've got the same issue and I'm on Node 4.4.5. This is my event log entry: Anwendung: devenv.exe Frameworkversion: v4.0.30319 Beschreibung: Der Prozess wurde aufgrund einer unbehandelten Ausnahme beendet. Ausnahmeinformationen: System.OutOfMemoryException bei Microsoft.NodejsTools.Analysis.AnalysisSetDetails.AnalysisHashSet.Clone() bei Microsoft.NodejsTools.Analysis.AnalysisSet.Create(System.Collections.Generic.IEnumerable1) bei Microsoft.NodejsTools.Analysis.Analyzer.DependentKeyValue.AddTypes(Microsoft.NodejsTools.Analysis.ProjectEntry, Microsoft.NodejsTools.Analysis.JsAnalyzer, Microsoft.NodejsTools.Analysis.IAnalysisSet, Microsoft.NodejsTools.Analysis.IAnalysisSet, Boolean) bei Microsoft.NodejsTools.Analysis.Values.ExpandoValue.SetIndex(Microsoft.NodejsTools.Parsing.Node, Microsoft.NodejsTools.Analysis.AnalysisUnit, Microsoft.NodejsTools.Analysis.IAnalysisSet, Microsoft.NodejsTools.Analysis.IAnalysisSet) bei Microsoft.NodejsTools.Analysis.AnalysisSetExtensions.SetIndex(Microsoft.NodejsTools.Analysis.IAnalysisSet, Microsoft.NodejsTools.Parsing.Node, Microsoft.NodejsTools.Analysis.AnalysisUnit, Microsoft.NodejsTools.Analysis.IAnalysisSet, Microsoft.NodejsTools.Analysis.IAnalysisSet) bei Microsoft.NodejsTools.Analysis.Analyzer.ExpressionEvaluator.AssignTo(Microsoft.NodejsTools.Parsing.Node, Microsoft.NodejsTools.Parsing.Expression, Microsoft.NodejsTools.Analysis.IAnalysisSet) bei Microsoft.NodejsTools.Analysis.Analyzer.ExpressionEvaluator.EvaluateBinary(Microsoft.NodejsTools.Analysis.Analyzer.ExpressionEvaluator, Microsoft.NodejsTools.Parsing.Node) bei Microsoft.NodejsTools.Analysis.Analyzer.ExpressionEvaluator.EvaluateWorker(Microsoft.NodejsTools.Parsing.Node) bei Microsoft.NodejsTools.Analysis.Analyzer.DDG.Walk(Microsoft.NodejsTools.Parsing.ExpressionStatement) bei Microsoft.NodejsTools.Parsing.ExpressionStatement.Walk(Microsoft.NodejsTools.Parsing.AstVisitor) bei Microsoft.NodejsTools.Analysis.Analyzer.DDG.Walk(Microsoft.NodejsTools.Parsing.Block) bei Microsoft.NodejsTools.Parsing.Block.Walk(Microsoft.NodejsTools.Parsing.AstVisitor) bei Microsoft.NodejsTools.Analysis.Analyzer.FunctionAnalysisUnit.AnalyzeWorker(Microsoft.NodejsTools.Analysis.Analyzer.DDG, System.Threading.CancellationToken) bei Microsoft.NodejsTools.Analysis.Analyzer.DDG.Analyze(Microsoft.NodejsTools.Analysis.Deque1<Microsoft.NodejsTools.Analysis.AnalysisUnit>, System.Threading.CancellationToken) bei Microsoft.NodejsTools.Analysis.JsAnalyzer.AnalyzeQueuedEntries(System.Threading.CancellationToken) bei Microsoft.NodejsTools.Intellisense.VsProjectAnalyzer+AnalysisQueue+GroupAnalysis.Analyze(System.Threading.CancellationToken) bei Microsoft.NodejsTools.Intellisense.VsProjectAnalyzer+AnalysisQueue.Worker(System.Object) bei System.Threading.ThreadHelper.ThreadStart_Context(System.Object) bei System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) bei System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) bei System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) bei System.Threading.ThreadHelper.ThreadStart(System.Object)

TbLtzk commented 8 years ago

I'm working with an existing nodejs project imported into vs. When I open the solution now I how on of my cpu cores at maximum constantly. Memory usage trends upwards but currently remains at roghly 1GB. It is a small project with a handfull of scripts and only few dependencies. Any chance to just disable code analysis or something?

bofcarbon1 commented 8 years ago

That's what I heard try to disable code analysis. Cloud 9 has issue as well. It uses UBUNTU and generates some minimal NodeJS app structure. It will create a little chat app using mostly sockets. When I go to a tutorial and try to build using npm I can never get through the dependencies. Something is always breaking and I spend hours on npm dependency building alone. Seems like there are so many variations on these MEAN stack approaches. Its difficult to get consistency on the bootstrapping so that I can focus on the real application code.

mjbvz commented 8 years ago

@TbLtzk You can disable intellisense fully by going to Tools -> Options -> Text Editor -> Node.js -> IntelliSense and selecting the None level.

However, I also recommend that you try downloading the NTVS 1.2 Alpha and trying it on VS2015 Update 2 with the ES6 Preview intellisense level. ES6 preview intellisense fixes the majority of our intellisense performance problems, while NTVS 1.2 Alpha also fixes a number of major memory leaks and includes a number of other improvements and optimizations. We are not able to backport the Intellisense improvements to NTVS 1.1.

Closing this issue since we have made major fixes and improvements with NTVS 1.2. If you are running into a consistent crash with any version of NTVS, or performance problems with NTVS 1.2 alpha, please open new issues to track these. Thanks.

TbLtzk commented 8 years ago

@mjbvz yes, seems that the ES6 preview setting fixed it for me as well, thx!