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

Uncaught TypeError: Cannot read property 'process' of null #5

Open
tmm1 opened this issue Sep 28, 2015 · 15 comments
Open

Uncaught TypeError: Cannot read property 'process' of null #5

tmm1 opened this issue Sep 28, 2015 · 15 comments

Comments

@tmm1
Copy link

tmm1 commented Sep 28, 2015

Atom Version: 1.0.19
System: Mac OS X 10.11
Thrown From: nim package, v0.3.0

Stack Trace

Uncaught TypeError: Cannot read property 'process' of null

At /Users/tmm1/.atom/packages/nim/lib/persistent-caas.coffee:33

TypeError: Cannot read property 'process' of null
  at /Users/tmm1/.atom/packages/nim/lib/persistent-caas.coffee:33:19
  at FSReqWrap.oncomplete (fs.js:82:15)

Commands

     -0:40.5.0 vim-mode:undo (atom-text-editor.editor.vim-mode.is-focused.normal-mode)
  2x -0:40 vim-mode:move-up (atom-text-editor.editor.vim-mode.is-focused.normal-mode)
     -0:39 vim-mode:put-before (atom-text-editor.editor.vim-mode.is-focused.normal-mode)
     -0:38.3.0 vim-mode:move-down (atom-text-editor.editor.vim-mode.is-focused.normal-mode)
 11x -0:38.2.0 vim-mode:move-right (atom-text-editor.editor.vim-mode.is-focused.normal-mode)
  2x -0:37.6.0 vim-mode:move-up (atom-text-editor.editor.vim-mode.is-focused.normal-mode)
     -0:36.7.0 vim-mode:move-to-previous-word (atom-text-editor.editor.vim-mode.is-focused.normal-mode)
     -0:35.6.0 vim-mode:change (atom-text-editor.editor.vim-mode.is-focused.normal-mode)
     -0:35.5.0 vim-mode:move-to-next-word (atom-text-editor.editor.vim-mode.is-focused.operator-pending-mode)
     -0:34.8.0 vim-mode:activate-normal-mode (atom-text-editor.editor.vim-mode.is-focused.insert-mode)
     -0:34.5.0 core:save (atom-text-editor.editor.vim-mode.is-focused.normal-mode)
  2x -0:33.9.0 blur (atom-text-editor.editor.vim-mode.is-focused.normal-mode)
     -0:05.0 vim-mode:undo (atom-text-editor.editor.vim-mode.normal-mode.is-focused)
     -0:03.4.0 core:save (atom-text-editor.editor.vim-mode.normal-mode.is-focused)
  2x -0:03.0 vim-mode:undo (atom-text-editor.editor.vim-mode.normal-mode.is-focused)
     -0:01.8.0 core:save (atom-text-editor.editor.vim-mode.normal-mode.is-focused)

Config

{
  "core": {
    "disabledPackages": [
      "terminal",
      "git-plus",
      "atomatigit",
      "term2",
      "language-nim"
    ],
    "themes": [
      "one-dark-ui",
      "atom-dark-syntax"
    ]
  },
  "nim": {
    "nimExecutablePath": "/usr/local/bin/nim",
    "nimsuggestEnabled": true,
    "nimsuggestExecutablePath": "~/.nimble/bin/nimsuggest"
  }
}

Installed Packages

# User
autocomplete-clang, v0.8.7
autocomplete-emojis, v2.2.2
color-picker, v2.0.12
ex-mode, v0.7.0
git, v0.0.0
go-plus, v3.5.1
language-puppet, v0.14.0
language-rust, v0.4.5
linter, v1.6.0
linter-rust, v0.2.9
minimap, v4.13.4
minimap-git-diff, v4.1.8
minimap-hide, v0.3.0
nim, v0.3.0
racer, v0.17.2
remote-atom, v1.2.7
rust-api-docs-helper, v0.5.1
script, v2.29.0
vim-mode, v0.60.0

# Dev
No dev packages
@tmm1
Copy link
Author

tmm1 commented Sep 28, 2015

Seeing these as well:

Stack Trace

Uncaught Error: This socket has been ended by the other party

At events.js:141

Error: This socket has been ended by the other party
  at Socket.writeAfterFIN [as write] (net.js:266:12)
  at /Users/tmm1/.atom/packages/nim/lib/persistent-caas.coffee:33:34
  at FSReqWrap.oncomplete (fs.js:82:15)

@russpowers
Copy link
Owner

Thanks for the report. It looks like nimsuggest is crashing, which happens a lot, but it's not being handled properly... I'm not able to reproduce this, can you check the javascript console for errors and copy/paste them here?

@ghost
Copy link

ghost commented Sep 29, 2015

persistent-caas.coffee:72 Nimsuggest crashed...
events.js:141 Uncaught Error: read ECONNRESET
persistent-caas.coffee:72 Nimsuggest crashed...
events.js:141 Uncaught Error: read ECONNRESET
persistent-caas.coffee:72 Nimsuggest crashed...
events.js:141 Uncaught Error: read ECONNRESET
persistent-caas.coffee:72 Nimsuggest crashed...
executor.coffee:68 ERROR: Command failed multiple times.
Command:
SUGGESTIONS: /src/nim/test.nim,8,8
Output:
Traceback (most recent call last)
nimsuggest.nim(355)      nimsuggest
nimsuggest.nim(336)      handleCmdLine
Error: unhandled exception: Cannot find Nim standard library: Nim compiler not in PATH [IOError]

@russpowers
Copy link
Owner

Ok, there was an issue with timing on some of the error handling related to temp files. That should be fixed now, although I can't verify it since I couldn't replicate the error. I'll leave this open, please let me know if either of you see that same null error anymore.

@ghost
Copy link

ghost commented Sep 30, 2015

Uncaught Error: read ECONNRESET
persistent-caas.coffee:74 Nimsuggest crashed...
events.js:141 Uncaught Error: read ECONNRESET
persistent-caas.coffee:74 Nimsuggest crashed...
events.js:141 Uncaught Error: read ECONNRESET
persistent-caas.coffee:74 Nimsuggest crashed...
events.js:141 Uncaught Error: read ECONNRESET
persistent-caas.coffee:74 Nimsuggest crashed...
executor.coffee:68 ERROR: Command failed multiple times.
Command:
SUGGESTIONS: /home/user/src/nim/project/test.nim,2,2
Output:
Error: cannot open '/home/user/src/nim/lib/system.nim'
Traceback (most recent call last)
nimsuggest.nim(355)      nimsuggest
nimsuggest.nim(345)      handleCmdLine
nimsuggest.nim(281)      mainCommand
modules.nim(205)         compileProject
modules.nim(188)         compileSystemModule
modules.nim(158)         compileModule
modules.nim(66)          doCRC
securehash.nim(22)       secureHashFile
sysio.nim(192)           readFile
system.nim(2537)         sysFatal
Error: unhandled exception: cannot open: /home/user/src/nim/lib/system.nim [IOError]

Problem is it looks for stdlib in wrong dir.

~ % whereis nim
nim: /home/user/src/nim/Nim/bin/nim

And stdlib is in /home/user/src/nim/Nim/lib.

@russpowers
Copy link
Owner

This looks like an internal problem with nimsuggest... It's crashing because it can't find a file.

@tmm1
Copy link
Author

tmm1 commented Sep 30, 2015

I'm having a similar issue, I have nimsuggest installed in ~/.nimble/bin and its unable to find system.nim:

SUGGESTIONS: /Users/tmm1/code/nim/compiler/pragmas.nim,848,68
Output:
Error: cannot open '/Users/tmm1/.nimble/pkgs/lib/system.nim'
Error: unhandled exception: cannot open: /Users/tmm1/.nimble/pkgs/lib/system.nim [IOError]

708 console messages are not shown.

@tmm1
Copy link
Author

tmm1 commented Sep 30, 2015

In another project it's trying to access /usr/local/lib/system.nim when using /usr/local/bin/nim

ERROR: Command failed multiple times.
Command:
DEFINITION: /Users/tmm1/code/c2nim/postprocessor.nim,19,18
Output:
Error: cannot open '/usr/local/lib/nim/system.nim'
Error: unhandled exception: cannot open: /usr/local/lib/nim/system.nim [IOError]

@russpowers
Copy link
Owner

I've been reading through the issues over at nimsuggest, and it looks like there are sometimes problems locating the nim library folder. The solution is either to move the nimsuggest executable into the nim bin folder or to explicitly set the lib path via the --lib nim compiler option. I've added a config key Nim Lib Path where you can set that library path. Try it out and let me know how it goes.

@ghost
Copy link

ghost commented Oct 1, 2015

This helps, thanks!

@yglukhov
Copy link
Contributor

I'm still hitting this issue occasionaly even though I have set lib path :(
Edit: tightly related to #7

@russpowers
Copy link
Owner

Nimsuggest crashes constantly, especially if a macro is involved (if the macro evaluation crashes, nimsuggest crashes)... I've tried to write code that handles those crashes gracefully, but there must still be a problem there somewhere. I'll take a look.

@yglukhov
Copy link
Contributor

yglukhov commented Apr 7, 2016

@russpowers, fyi, i'm still experiencing this problem occasionally:
stack:

TypeError: Cannot read property 'process' of null
    at /Users/yglukhov/.atom/packages/nim/lib/persistent-caas.coffee:35:19
    at /Applications/Atom.app/Contents/Resources/app.asar/node_modules/babel-core/node_modules/regenerator/node_modules/commoner/node_modules/graceful-fs/graceful-fs.js:43:10
    at FSReqWrap.oncomplete (fs.js:82:15)

@russpowers
Copy link
Owner

Thanks for the report @yglukhov. Sorry I haven't been able to fix this yet, been very busy on other projects. I will try to set aside some time to see if I can figure out what is causing this...

@singularperturbation
Copy link

I was able to look in dev tools and see that this was because nimsuggest itself was not finding the Nim compiler when the editor was started (though I had the full path in my package settings). I was able to work around by starting atom from a terminal with the $PATH set correctly.

I'll see if I can make a fix for this (by mutating the $PATH when starting nimsuggest).

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

4 participants