JavaScript-Completions icon indicating copy to clipboard operation
JavaScript-Completions copied to clipboard

Sublime freezing at startup

Open matduarte opened this issue 7 years ago • 27 comments

Every time on running of ST, JavaScript-Completions checks Node.js version, this cause ST freezing for 4 - 5 seconds.

matduarte avatar Sep 20 '16 20:09 matduarte

I didn't notice it! Maybe because on my computer it takes only ~1 second This happens because I handle the loading of some files of the plugin in a certain way! I will try to solve this!

Thanks for the support!

pichillilorenzo avatar Sep 20 '16 21:09 pichillilorenzo

Hello guys, I'd like to say Thank you to author of this plugin, great job buddy! I tried to install plugin in some scenarios (SBT3, portable stable build 3114, Win 7x64):

  • with plugins,
  • fresh SBT portable (no plugins),
  • fresh SBT3 install (no plugins).

Well, there are some issues - I'm not expert on this, so I'll not speculate... you can see my complete log after fresh start, if you are interested.

And once more... Thank you @pichillilorenzo for your hard work!

log.txt

sofoklesion avatar Sep 21 '16 10:09 sofoklesion

@sofoklesion I update it! I was testing it on windows and i was having your same issue. Now it should be ok! Say me if it works!

Wait until Package Control update my url for this new release!

pichillilorenzo avatar Sep 21 '16 15:09 pichillilorenzo

OK buddy, I will come back to you with updated status after proper upgrade from package control.

sofoklesion avatar Sep 21 '16 21:09 sofoklesion

Package Control updated it. You can check now!

pichillilorenzo avatar Sep 21 '16 21:09 pichillilorenzo

Cool, I'm on it, will be back in couple minutes with result.

sofoklesion avatar Sep 21 '16 22:09 sofoklesion

OK, I did two scenarios:

  • upgrade via control package
  • clean install (all rest files in SBT3 cleared)

nodejs problem is gone and seems to be fast proces with no impact to user. But there is some issue with import _init... you can see my fresh log. (This issue is valid for both scenarios)

Thanks @pichillilorenzo

log-2016-09-22-0011hod.txt

sofoklesion avatar Sep 21 '16 22:09 sofoklesion

The "import _init" issue is a false-positive! This happens, like i said before, because I handle the loading of some files of the plugin in a certain way! So it isn't a real issue :thumbsup:

However i'm going to update this plugin with some other features!

pichillilorenzo avatar Sep 21 '16 23:09 pichillilorenzo

Aha... ok, thanks for your work. I'm looking forward to it! Wish you the best... :+1:

sofoklesion avatar Sep 21 '16 23:09 sofoklesion

Hey @matduarte! i found the "issue" that cause ST freezing. My plugin has dependencies with some other my python modules. Sublime Text 3 loads plugin in async way, so i must check and, in case, reload these python modules to make plugin work properly!

pichillilorenzo avatar Sep 26 '16 19:09 pichillilorenzo

Hi @pichillilorenzo, I tried to activate your plugin and could see in SBT3 console:

  • "Error: Cannot find module 'C:\Program Files\nodejs\node_modules\npm\bin\node_modules\npm\bin\npm-cli.js'"
  • Seems path shoud be: "\nodejs\node_modules\npm\bin\npm-cli.js" --> part "\node_modules\npm\bin" is repeating yourself and of course cannot be found.
  • Maybe some troubles with vars definition in node_variables.py?

ENV:

  • portable SBT3-x64, latest stable build, installed on non-system hdd (D:)
  • win 7 x64
  • node 6.6.0

ghost avatar Sep 29 '16 09:09 ghost

@infobeny To use npm on windows, you must download and install it on your own from https://nodejs.org/! i can't install locally in automatic way on windows, like I do instead for OSX and Linux, because of some problems about the folder tree depth of npm packages!

In /node/main.py, for windows, i use directly "npm" without the entire path, like I do instead for OSX and Linux, because of the problem i explained.

So have you installed npm on your system??

However I done a test and I used:

  • portable SBT3-x64, latest stable build, installed on USB (D:)
  • win 10 x64
  • node 6.6.0

and the plugin works properly.

Obviously i have npm installed on the system!

In case you could post the whole log file!

pichillilorenzo avatar Sep 29 '16 10:09 pichillilorenzo

@infobeny try this: http://stackoverflow.com/a/24741740

pichillilorenzo avatar Sep 29 '16 10:09 pichillilorenzo

Good point @pichillilorenzo. I'm using npm every day and no problem. I checked system path and and except C:\Program Files\nodejs there was extra path C:\Program Files\nodejs\node_modules\npm\bin. When you delete this extra path, there is no problem with your plugin anymore. thx!

ghost avatar Sep 29 '16 17:09 ghost

Hello, I've got a similar problem :( Downloaded the newest NodeJS (v7.0.0), changed in settings to use this version, but every time I start ST3 this happens: TL;DW: goto sec 53 ST3 JS Completions Node problem it lasts 58 secs, so I recommend to see the url

mike-czarnota avatar Oct 27 '16 11:10 mike-czarnota

@panczarny What is the problem? i didn't understand! Can you post logs from Sublime Text console please??

pichillilorenzo avatar Oct 27 '16 12:10 pichillilorenzo

I think this might be an issue:

Traceback (most recent call last):
File "C:\Users\michal\AppData\Roaming\Sublime Text 3\Packages\JavaScript Completions\node\installer.py", line 117, in checkUpgrade if node_js.getCurrentNodeJSVersion() != nodejs_latest_version :
File "C:\Users\michal\AppData\Roaming\Sublime Text 3\Packages\JavaScript Completions\node\main.py", line 56, in getCurrentNodeJSVersion raise Exception(lines)
Exception: '"C:\Users\michal\AppData\Roaming\Sublime Text 3\Packages\JavaScript Completions\node_binaries\windows-64bit\node.exe"' is not recognized as an internal or external command, operable program or batch file.

But this is weird, because I've got the newest NodeJS version that is available installed...

mike-czarnota avatar Nov 14 '16 07:11 mike-czarnota

most javaScript developers have an experience with nodejs now and have certainly installed it in their computer.

I think it will better to just install the plugin and let it try to use user's installed nodejs instead of automatically try to install local one. An option can be provided for user who don't have a global nodejs installation, to enable automatic download, update and usage of local one. Another option can be provided to disable automatic npm update.

tnga avatar Jan 20 '17 07:01 tnga

Hey, any progress on the issue of sublime text freezing for 4-5 seconds on every load?

flawiddsouza avatar Jan 21 '17 10:01 flawiddsouza

@tnga I install nodejs and npm local because of implementation of plugin features, such as JSDoc or "Evaluate JavaScript".

@flawiddsouza not yet

pichillilorenzo avatar Mar 05 '17 16:03 pichillilorenzo

The problem is not caused by Node.js but from loading of all the sublime-completions files! I will update it as soon as possible

pichillilorenzo avatar Mar 05 '17 23:03 pichillilorenzo

@flawiddsouza try the new version about the freezing problem and let me know!

pichillilorenzo avatar Mar 30 '17 19:03 pichillilorenzo

The lag is lesser but it hasn't completely disappeared. 2-3 seconds now :confused:

flawiddsouza avatar Mar 31 '17 00:03 flawiddsouza

Ok @flawiddsouza! I will check it again, but it is strange because i load my sublime completions in an asynchronous way!

pichillilorenzo avatar Mar 31 '17 01:03 pichillilorenzo

Disabling this package removes the lag, so I'm pretty sure the problem is in here somewhere. I'm on a SSD and I still get this. Maybe it's the npm check at startup. Is there anything I give you to help you with this?

flawiddsouza avatar Mar 31 '17 01:03 flawiddsouza

Installing nodejs and/or checking for update with npm is done also in asynchronous way! I will check later if I can solve this! Thanks

pichillilorenzo avatar Mar 31 '17 06:03 pichillilorenzo

Any news ?

jeremy447 avatar Sep 10 '17 14:09 jeremy447