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.
Evaluating valid forms like
(+ 1 1)
ornbb.core/*file*
work as expected. However, evaluating an invalid form, such asfoobar
whenfoobar
hasn't been defined, will result in the nREPL server immediately exiting, and the following output is displayed in the terminal.Environment
I was able to produce this problem using
Emacs-specific steps My working directory is laid out as follows:
Then
nbb nrepl-server
is executed withindir
. I opentest.cljs
, which looks as follows.Then I type
M-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 openscripts/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.