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

Still getting odd module import errors after updates #27

Open
rwols opened this issue Sep 19, 2020 · 4 comments
Open

Still getting odd module import errors after updates #27

rwols opened this issue Sep 19, 2020 · 4 comments

Comments

@rwols
Copy link
Member

rwols commented Sep 19, 2020

LSP-json: internal/modules/cjs/loader.js:800
LSP-json:     throw err;
LSP-json:     ^
LSP-json: 
LSP-json: Error: Cannot find module '/home/raoul/.config/sublime-text-3/Cache/LSP-json/language-server/out/node/jsonServerMain.js'
LSP-json:     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:797:15)
LSP-json:     at Function.Module._load (internal/modules/cjs/loader.js:690:27)
LSP-json:     at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10)
LSP-json:     at internal/main/run_main_module.js:17:11 {
LSP-json:   code: 'MODULE_NOT_FOUND',
LSP-json:   requireStack: []
LSP-json: }

Use the needs_update_or_installation and install_or_update classmethods and these problems will likely go away.

EDIT: actually I think we need to take care of sublimelsp/LSP#899 to get smooth updates.

@rchl
Copy link
Member

rchl commented Sep 19, 2020

We've previously identified some problems with ST's file database causing issues but that was only affecting local, sym-linked repo and was related to changing branches. It shouldn't trigger for normal uses through PC.

EDIT: actually I think we need to take care of sublimelsp/LSP#899 to get smooth updates.

I can't think of any reason why that would cause such issues.

@rchl
Copy link
Member

rchl commented Sep 21, 2020

Can you confirm whether by "updates" you mean pulling in git or normal Package Control updates?

@rwols
Copy link
Member Author

rwols commented Sep 21, 2020

When updating via Package Control.

I can only make a guess, but I think what happens is something like this:

  • ST starts up
  • I have a (for instance) a json file
  • LSP-json is running
  • Package Control checks for updates
  • Package Control calls plugin_unloaded of LSP-json. This leads to a shutil.rmtree I think?
  • Package Control replaces LSP-json.sublime-package
  • Package Control calls plugin_loaded of LSP-json. This spawns a thread that installs various node modules.

In any case, meanwhile, LSP-json is running in my json file. On a linux filesystem this should not matter in theory right? File handles are reference-counted. Ideally LSP would stop the running LSP-json server in plugin_unloaded.

@rchl
Copy link
Member

rchl commented Sep 21, 2020

Weird.

When it happens next time it might be helpful to see logs from the console to see what exactly has been updated (maybe it's related to lsp_utils upgrading).

EDIT: Oh, this is an issue in lsp_utils repo... :)
Handling lsp_utils upgrades might be tricky, I guess.

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

No branches or pull requests

2 participants