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

nREPL server exits on evaluation error #306

Closed
throwaway974 opened this issue Feb 11, 2023 · 1 comment
Closed

nREPL server exits on evaluation error #306

throwaway974 opened this issue Feb 11, 2023 · 1 comment

Comments

@throwaway974
Copy link

Evaluating valid forms like (+ 1 1) or nbb.core/*file* work as expected. However, evaluating an invalid form, such as foobar when foobar hasn't been defined, will result in the nREPL server immediately exiting, and the following output is displayed in the terminal.

% nbb nrepl-server
nREPL server started on port 60705 on host 127.0.0.1 - nrepl://127.0.0.1:60705

file:///opt/local/lib/node_modules/nbb/lib/nbb_core.js:326
...
Al [Error]: Could not resolve symbol: foobar
    at new Al (file:///opt/local/lib/node_modules/nbb/lib/nbb_core.js:176:80)
    at $APP.xn.j (file:///opt/local/lib/node_modules/nbb/lib/nbb_core.js:1250:319)
    at $APP.xn.h (file:///opt/local/lib/node_modules/nbb/lib/nbb_core.js:1250:273)
    at bs (file:///opt/local/lib/node_modules/nbb/lib/nbb_core.js:326:191)
    at nu (file:///opt/local/lib/node_modules/nbb/lib/nbb_core.js:443:378)
    at Du (file:///opt/local/lib/node_modules/nbb/lib/nbb_core.js:453:84)
    at Ku.j (file:///opt/local/lib/node_modules/nbb/lib/nbb_core.js:1697:87)
    at Ku.h (file:///opt/local/lib/node_modules/nbb/lib/nbb_core.js:1696:30)
    at $w (file:///opt/local/lib/node_modules/nbb/lib/nbb_core.js:2198:499)
    at $APP.mx (file:///opt/local/lib/node_modules/nbb/lib/nbb_core.js:623:121)

Environment

  • Mac OS 10.15.7
  • Node.js v18.14.0
  • NPM 9.4.1
  • nbb 1.2.162 (installed globally)

I was able to produce this problem using

  • Emacs 28.2 with CIDER 1.6.0
  • The latest VS Code with Calva installed

Emacs-specific steps
My working directory is laid out as follows:

dir/
  scripts/
    test.cljs

Then nbb nrepl-server is executed within dir. I open test.cljs, which looks as follows.

(ns scripts.test)

Then I typeM-x cider-connect-cljs and connect to the nREPL server directly. I am able to evaluate forms, get autocomplete, etc. up until I attempt evaluating something invalid.

VS Code specific steps
Open the dir folder, then open scripts/test.cljs. On the bottom of the VS Code window, click "REPL" then click "Start your project with a REPL and connect". You can still evaluate forms, get autocomplete, and so on. But evaluating an invalid form will cause the REPL to suddenly exist. You can verify this by looking at the bottom of the VS Code window changing.

@borkdude
Copy link
Collaborator

Releasing as 1.2.163 on CI

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