Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does swank-js give me "document is not defined" in the emacs REPL?

I follow these steps:

  1. Run swank-js in the command line.
  2. Run emacs.
  3. M-x slime-connect.
  4. Host: 127.0.0.1; Port: 4005
  5. Open up the http://localhost:8009/swank-js/test.html in Firefox.
  6. Receive: "Remote attached: (browser) Firefox14.0" in the emacs REPL.
  7. Run the command "document" in the REPL.

At this point, I receive the error:

ReferenceError: document is not defined
    at repl:1:1
    at DefaultRemote.evaluate (/usr/lib/nodejs/swank-js/swank-handler.js:314:9)
    at Executive.listenerEval (/usr/lib/nodejs/swank-js/swank-handler.js:414:21)
    at Handler.receive (/usr/lib/nodejs/swank-js/swank-handler.js:169:20)
    at SwankParser.onMessage (/usr/lib/nodejs/swank-js/swank.js:50:17)
    at SwankParser.handleMessage (/usr/lib/nodejs/swank-js/swank-protocol.js:75:8)
    at SwankParser.handleContent (/usr/lib/nodejs/swank-js/swank-protocol.js:62:10)
    at SwankParser.execute (/usr/lib/nodejs/swank-js/swank-protocol.js:53:20)
    at Socket.<anonymous> (/usr/lib/nodejs/swank-js/swank.js:60:16)
    at Socket.emit (events.js:67:17)

Should I be using require() or something? I'm still a bit hazy how swank/slime/node are communicating so please forgive the black box nature of this question. :D

like image 721
sdasdadas Avatar asked Aug 22 '12 04:08

sdasdadas


1 Answers

Judging by the bug report at https://github.com/swank-js/swank-js/issues/49#issuecomment-8079040, I'd guess you aren't loading the slime-js component.

like image 83
Jonathan Arkell Avatar answered Oct 23 '22 01:10

Jonathan Arkell