Galooshi / sublime-import-js

Sublime Text plugin for ImportJS
MIT License
24 stars 2 forks source link

Fix all imports freezes Sublime_text 3 #16

Closed bradtaniguchi closed 7 years ago

bradtaniguchi commented 7 years ago

Hi all,

I was trying to start using importjs, as I want to use sublime for a typescript project and when I tried to import a module by running "Importjs: fix all imports" Sublime_text totally freezes.

I also fixed my path earlier as the plugin couldn't find the importjs global installation (I use nvm) so it seems like everything is connected correctly.

OS: Ubuntu 16.04.3 LTS (xenial) Sublime build: 3143 (stable) Node Version: v8.2.1 Python 3 version: 3.5.2

PS. I don't use sublime that much, is there a way to get a stack trace or verbose output with it so I could help debugging the issue more??

Thank you

trotzig commented 7 years ago

If you run importjs logpath you get a path to a file that importjs uses for logging. I have a vague memory of running into this in the past while developing the sublime plugin but I can't recall what caused it. Let's hope there's something useful in the log file.

bradtaniguchi commented 7 years ago

Sorry for being a day slow The log path printed is /tmp/importjs.log and below is it's contents

1506530627164 ERROR PID:15783 Watchman:  Watchman was not found in PATH.  See https://facebook.github.io/watchman/docs/install.html for installation instructions
1506530627167 WARN PID:15783 
          Couldn't initialize the Watchman watcher. This is most likely because
          you don't have Watchman installed. Follow instructions here if you
          want to rid this warning:
          https://facebook.github.io/watchman/docs/install.html

          ImportJS will fall back to polling instead. This is slower, and more
          resource-heavy. Plus, changes will not be immediately available.

          Reason: Watchman was not found in PATH.  See https://facebook.github.io/watchman/docs/install.html for installation instructions
Error: Watchman was not found in PATH.  See https://facebook.github.io/watchman/docs/install.html for installation instructions
    at exports._errnoException (util.js:1024:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:192:19)
    at onErrorNT (internal/child_process.js:374:16)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)

1506530627411 ERROR PID:15783 Failed to resolve "@types/jasmine" relative to /home/brad/Sandbox/angular4-playground
1506530627412 ERROR PID:15783 Failed to resolve "@types/node" relative to /home/brad/Sandbox/angular4-playground
1506530627462 ERROR PID:15783 Failed to resolve "karma-cli" relative to /home/brad/Sandbox/angular4-playground
trotzig commented 7 years ago

I think the watchman error is mostly unrelated, but you could try installing it and see if that makes any difference.

bradtaniguchi commented 7 years ago

I installed watchmen, and I no longer get the first error.

I had to restart and everything seems to be working. So is it possible watchmen is a dependency?

trotzig commented 7 years ago

It's likely that there is a bug with the fallback. I've been going back and forth about whether to include it as a hard dependency or not. I don't want to force it on people, but then again, if the backup solution isn't working well we might as well kill it.

Thanks for following up. I'll close this issue until I hear about others running into the same thing. And at that time we can make a decision about whether to drop support or not.