Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Crash / Entire window goes blank - in projects using Ionic #7262

Closed
boozedog opened this issue Mar 20, 2014 · 53 comments
Closed

Crash / Entire window goes blank - in projects using Ionic #7262

boozedog opened this issue Mar 20, 2014 · 53 comments

Comments

@boozedog
Copy link

I'm running sprint 37 on Mac OS X 10.9.2 . The entire Brackets window goes blank eventually, and at that point I'm not able to even quit the application, must Force Quit in Finder.

@boozedog
Copy link
Author

Switching back to sprint 36 in the meantime. Very weird!

@njx
Copy link
Contributor

njx commented Mar 20, 2014

Ack, that's terrible. Next time it happens, can you try (from Chrome) going to localhost:9234, click on the "Brackets" link if there is one, and see if there are any errors in the console?

@boozedog
Copy link
Author

Sure I'll install 37 side-by-side with 36 and share what I find ...

@redmunds
Copy link
Contributor

@boozedog

install 37 side-by-side with 36

To do this, install Sprint 36, then make a copy of the entire Brackets install folder, then install Sprint 37 (which installs over Brackets folder).

@boozedog
Copy link
Author

@redmunds sorry I don't quite follow. Right now I have Sprint 36 and Sprint 37 separately in my Applications folder (this is Mac OS X). Is that what I want?

@boozedog
Copy link
Author

BTW just noticed some of my extensions were out of date. I've updated them, let's see if that solves it. Will post any failures here.

@redmunds
Copy link
Contributor

That's perfect. I missed that you were on Mac.

@boozedog
Copy link
Author

OK this is weird. Screen went blank, then I went to http://localhost:9234/ in Chrome, and I get webpage not available?!

@redmunds
Copy link
Contributor

We've heard reports of this problem, although it's rare and it has been a while, but since it's so nasty we'd love to try to nail this down. Can you provide a set of reproducible steps that makes it happen every time? That would help us to track it down. Thanks.

@redmunds
Copy link
Contributor

Also, see if you can reproduce it with no extensions installed. You can use Debug > Reload Without Extensions to quickly run without extensions (and restarting Brackets returns to loading of extensions). If that eliminates problem, then try to isolate which extension is causing problem.

@boozedog
Copy link
Author

Just crashed again. Had Chrome dev running at the time and it says "Inspected target has crashed. Once it reloads we will attach to it automatically."

Will try with no ext.

This is sprint 37.

@boozedog
Copy link
Author

Yikes. Just crashed again, this time with extensions disabled. Chrome gave the same "Inspected target has crashed. Once it reloads we will attach to it automatically." msg.

Still working on reproducible steps but right now it seems like

  1. Open Brackets
  2. Select a particular .js file
  3. Switch to browser and Google some stuff
  4. Come back to frozen, blank Brackets window.

@boozedog
Copy link
Author

OK I'm getting it to crash pretty consistently. I'm thinking it's this particular javascript file I'm working in. Confirmed that there is no useful information coming up in the Chrome dev console.

I'm gonna try to isolate if there's a particular part of the code in this file that's causing the problem.

@redmunds
Copy link
Contributor

What version of Chrome are you running? Switch to stable if you are running something else.

@boozedog
Copy link
Author

Version 33.0.1750.152 (stable).

I do have Chromium installed as well ...

@peterflynn
Copy link
Member

@boozedog Can you open up Activity Monitor on the side and see (a) if Brackets memory usage keeps climbing before it goes white, and (b) if Brackets CPU usage is high even when it's just sitting idle?

Also, are you able to share the source code of the project you're working on? (You can send it directly to us privately if you don't want to post it publicly anywhere).

@peterflynn
Copy link
Member

This sounds a lot like #7245, but it could wind up being a totally different repro case (even if both wind up being Tern-related)...

@boozedog
Copy link
Author

@peterflynn yeah actually it's Brackets Helper that goes way up in CPU and memory. Brackets itself stays low ... ??

@boozedog
Copy link
Author

Weirder and weirder. If I flip from one JS file to another, the BH CPU/mem usage keeps building. If I switch to an HTML file, it immediately drops back down.

Also, this is happening when I open any JS file in this project. It's an ionic app I'm working on.'

Will play more with this later this evening ...

@peterflynn
Copy link
Member

@boozedog How large is your project -- number of JS files, number of bytes of JS code overall? Do you have a lot of node_modules or other 3rd-party libraries in your project?

@boozedog
Copy link
Author

This is an client-side project using Ionic which is a framework built on Angular.

Total of about 150 .js files including all the libraries.

I'm having trouble figuring out the total number of bytes, there are several very large files in Angular and Ionic but I'd guess at least 10 megabytes?

@boozedog
Copy link
Author

OK so I tried the .jscodehints and excluded the directories with large library type .js files in them and that seems to solve the problem! I'm able to work with my .js files and no wacky CPU or memory usage!

@peterflynn
Copy link
Member

Reviewed - @dangoor to go with #7245

@peterflynn peterflynn changed the title Entire window goes blank! Crash / Entire window goes blank - in projects using Ionic May 2, 2014
@peterflynn
Copy link
Member

A user named "fels_zh" on IRC just reported a crash with a project using Ionic also -- changing title of bug to clarify that this is the common thread (was: "Entire window goes blank!")

@dangoor
Copy link
Contributor

dangoor commented May 3, 2014

I've just done some investigation of this specific issue. I can reproduce the crash, but I haven't tracked down precisely which file is to blame. ionic.bundle.js appears to not be to blame, because the JS code hints code doesn't send files greater than 512K over to the hinting engine and ionic.bundle.js is bigger than that (and I was able to see that the code hints was correctly noting the size of that file). I'll dig around some more.

@pthiess
Copy link
Contributor

pthiess commented May 3, 2014

Sounds promising -;)

On May 2, 2014, at 7:00 PM, "Kevin Dangoor" <notifications@github.commailto:notifications@github.com> wrote:

I've just done some investigation of this specific issue. I can reproduce the crash, but I haven't tracked down precisely which file is to blame. ionic.bundle.js appears to not be to blame, because the JS code hints code doesn't send files greater than 512K over to the hinting engine and ionic.bundle.js is bigger than that (and I was able to see that the code hints was correctly noting the size of that file). I'll dig around some more.

Reply to this email directly or view it on GitHubhttps://github.com//issues/7262#issuecomment-42093512.

dangoor added a commit that referenced this issue May 3, 2014
We've had a number of people report problems with Ionic in their projects.
Tern appears to have an issue with the minified Ionic files. I had planned
to add default exclusions so that we could quickly solve pain like this
and this problem appeared to be a good candidate. The repro steps
[reported here](#7262 (comment))
are fixed with this change.
@dangoor
Copy link
Contributor

dangoor commented May 3, 2014

I was better able to troubleshoot this with the new CEF and discovered that Tern was having trouble with all of the Ionic minified files. One bit of low hanging fruit in the plan for code hints that I'm working on was to ship some default exclusions with Brackets when we hear of a specific file (or files) that are commonly causing people pain. I've implemented that in #7739 with all of the ionic minified files excluded and found that things look much better.

@dangoor dangoor modified the milestones: Release #39, Brackets 1.0 May 6, 2014
@dangoor
Copy link
Contributor

dangoor commented May 6, 2014

This is now fixed in master by automatically ignoring the minified Ionic files.

@dangoor dangoor closed this as completed May 6, 2014
@shafdog
Copy link

shafdog commented May 6, 2014

I forgot to mention is that if you don't do the ionic build ios I wasn't readily able to repro the Brackets' black sreen hang. what that does is copy Ionic's problematic JS file to a directory under in Cordova-created XCode project. (ionic build ios appears to be just a shim around the standard cordova command line tool used to build an iOS PhoneGap project.) In other words, there are two copies in the directory tree, which may not be good for Tern, and I wasn't sure if that affected the fix for this.

Since I normally don't use Ionic and the .jscodehints workaround above worked, this issue isn't a big deal to me.

But since I've been following this wanted to at least add the detail since the fix (#7739) appears to be excluding file and wasn't sure which copy was going to be excluded. For the problematic ionic sample, I have the following files:

find ./ionic-hints -name ionic.bundle.js
./ionic-hints/platforms/ios/build/emulator/HelloCordova.app/www/lib/ionic/js/ionic.bundle.js
./ionic-hints/platforms/ios/www/lib/ionic/js/ionic.bundle.js
./ionic-hints/www/lib/ionic/js/ionic.bundle.js

In #7739 @JeffryBooher said "I was able to reproduce this eventually with the steps listed in the issue on Mac but the steps don't work on Windows.".

Without a Mac and Xcode, there also would not be multiple copies of the same complex Ionic JS file within the project as well.

@JeffryBooher
Copy link
Contributor

@shafdog good point. The problem I was running into on Windows was I couldn't get the ionic platform ios command to complete successfully. There was a problem with installing cordova ios that I don't fully understand.

@dangoor
Copy link
Contributor

dangoor commented May 6, 2014

@shafdog I'll need to re-test my fix. When I switched from regex to glob for the new preference, I inadvertently dropped ionic.bundle.js, only getting the .min.js files. Thanks for mentioning that. I'm going to reopen this bug in the meantime.

@dangoor dangoor reopened this May 6, 2014
@dangoor
Copy link
Contributor

dangoor commented May 6, 2014

OK, I just retested with the code in master and the project works fine, so it appears that it was the minified files and not the bundle.js file that caused the issue.

@dangoor dangoor closed this as completed May 6, 2014
@tomek-he-him
Copy link

In addition to widen/fine-uploader which I've mentioned before, I've just nailed down another library which causes this problem: crypto-js hosted on Google Code.

@redmunds
Copy link
Contributor

redmunds commented Jul 4, 2014

@tomekwi Thanks for the info. We made a change in Release 0.41 which should prevent Brackets from crashing -- have you tried it with 0.41?

@tomek-he-him
Copy link

Thank you. Next week I'll have an opportunity to test it, I'll let you know.

@gcacars
Copy link

gcacars commented Sep 24, 2014

Same here for Firefox and Ubuntu...

@LucasBadico
Copy link

Hey Guys, It is happening with me now.

Release 1.8 build 1.8.0-17108 (alf_localization_release_1.8 3af64fa)
build timestamp: Wed Nov 02 2016 04:47:30 GMT-0700

Just today crash 5 times. I work from a mac, El captain OS. This start right after the atualization for 1.8

@standinga
Copy link

I have the same problem OSX 10.11.6, Ionic 2.1.18. Brackets 1.8.0-17108

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests