manateelazycat / deno-bridge

Build bridge between Emacs and Deno, execution of JavaScript and Typescript within Emacs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error running the example in the Readme

haikyuu opened this issue · comments

I'm getting this error

Error caused by user's config or system: /Users/abdellah/.doom.d/modules/lang/imba/+other.el, (websocket-closed #s(websocket-frame text ["data",["ping","Hello from Emacs."]] nil t))

Here is the stack trace
image

Full:

Debugger entered--Lisp error: (websocket-closed #s(websocket-frame :opcode text :payload "[\"data\",[\"ping\",\"Hello from Emacs.\"]]" :length nil :completep t))
  websocket-send(nil #s(websocket-frame :opcode text :payload "[\"data\",[\"ping\",\"Hello from Emacs.\"]]" :length nil :completep t))
  websocket-send-text(nil "[\"data\",[\"ping\",\"Hello from Emacs.\"]]")
  deno-bridge-call("demo" "ping" "Hello from Emacs.")
  load-with-code-conversion("/Users/abdellah/.doom.d/modules/lang/imba/+other.e..." "/Users/abdellah/.doom.d/modules/lang/imba/+other.e..." nil t)
  load("/Users/abdellah/.doom.d/modules/lang/imba/+other" nil nomessage)
  (condition-case e (load path noerror 'nomessage) ((debug doom-error) (signal (car e) (cdr e))) ((debug error) (setq path (locate-file path load-path (get-load-suffixes))) (signal (cond ((not (and path (featurep ...))) 'error) ((file-in-directory-p path (expand-file-name "cli" doom-core-dir)) 'doom-cli-error) ((file-in-directory-p path doom-core-dir) 'doom-core-error) ((file-in-directory-p path doom-user-dir) 'doom-user-error) ((file-in-directory-p path doom-profile-dir) 'doom-profile-error) ((file-in-directory-p path doom-modules-dir) 'doom-module-error) ('doom-error)) (list path e))))
  doom-load("/Users/abdellah/.doom.d/modules/lang/imba/+other" nil)
  load-with-code-conversion("/Users/abdellah/.doom.d/modules/lang/imba/config.e..." "/Users/abdellah/.doom.d/modules/lang/imba/config.e..." nil t)
  load("~/.doom.d/modules/lang/imba/config" nil nomessage)
  (condition-case e (load path noerror 'nomessage) ((debug doom-error) (signal (car e) (cdr e))) ((debug error) (setq path (locate-file path load-path (get-load-suffixes))) (signal (cond ((not (and path (featurep ...))) 'error) ((file-in-directory-p path (expand-file-name "cli" doom-core-dir)) 'doom-cli-error) ((file-in-directory-p path doom-core-dir) 'doom-core-error) ((file-in-directory-p path doom-user-dir) 'doom-user-error) ((file-in-directory-p path doom-profile-dir) 'doom-profile-error) ((file-in-directory-p path doom-modules-dir) 'doom-module-error) ('doom-error)) (list path e))))
  doom-load("~/.doom.d/modules/lang/imba/config")
  byte-code("\305\306!\204\f\0\305\307!\2034\2\10\30\310\311!\211\203\"\0\211@\312\1!\210\1A\266\202\202\21\0\210\313\21\314\22\315\316\317\"\210\315\320\321\"\210\315..." [doom-context doom-modules doom-disabled-packages custom-file doom-module-context doom-context-p init reload ensure-list modules doom-context-push #<hash-table equal 43/65 0x572d7801> nil setplist :core (nil [0 -110 -110 :core nil nil nil]) :user (nil [1 105 -105 :user nil nil nil]) :completion (company [3 0 0 :completion company nil nil] vertico [4 0 0 :completion vertico nil nil]) :ui (doom [5 0 0 :ui doom nil nil] doom-dashboard [6 0 0 :ui doom-dashboard nil nil] hl-todo [7 0 0 :ui hl-todo nil nil] modeline [8 0 0 :ui modeline nil nil] ophints [9 0 0 :ui ophints nil nil] popup [10 0 0 :ui popup (+defaults) nil] treemacs [11 0 0 :ui treemacs nil nil] vc-gutter [12 0 0 :ui vc-gutter (+pretty) nil] vi-tilde-fringe [13 0 0 :ui vi-tilde-fringe nil nil] workspaces [14 0 0 :ui workspaces nil nil]) :editor (evil [15 0 0 :editor evil (+everywhere) nil] file-templates [16 0 0 :editor file-templates nil nil] fold [17 0 0 :editor fold nil nil] format [18 0 0 :editor format nil nil] multiple-cursors [19 0 0 :editor multiple-cursors nil nil] snippets [20 0 0 :editor snippets nil nil] word-wrap [21 0 0 :editor word-wrap nil nil]) :emacs (dired [22 0 0 :emacs dired nil nil] electric [23 0 0 :emacs electric nil nil] undo [24 0 0 :emacs undo nil nil] vc [25 0 0 :emacs vc nil nil]) :term (vterm [26 0 0 :term vterm nil nil]) :checkers (syntax [27 0 0 :checkers syntax nil nil]) :tools (editorconfig [28 0 0 :tools editorconfig nil nil] eval [29 0 0 :tools eval (+overlay) nil] lookup [30 0 0 :tools lookup (+dictionary +offline +docsets) nil] magit [31 0 0 :tools magit nil nil] tree-sitter [32 0 0 :tools tree-sitter nil nil]) :os (macos [33 0 0 :os macos nil nil] tty [34 0 0 :os tty nil nil]) :lang (imba [35 0 0 :lang imba nil nil] emacs-lisp [36 0 0 :lang emacs-lisp nil nil] json [37 0 0 :lang json nil nil] javascript [38 0 0 :lang javascript nil nil] markdown [39 0 0 :lang markdown nil nil] org [40 0 0 :lang org nil nil] sh [41 0 0 :lang sh nil nil]) :config (use-package [2 -111 -111 :config use-package nil nil] default [42 0 0 :config default (+bindings +smartparens) nil]) [2 -111 -111 :config use-package nil nil] doom-load "~/.emacs.d/modules/config/use-package/init" [0 -110 -110 :core nil nil nil] "~/.emacs.d/lisp/init" doom-run-hooks doom-before-modules-init-hook [15 0 0 :editor evil (+everywhere) nil] "~/.emacs.d/modules/editor/evil/init" doom-after-modules-init-hook doom-before-modules-config-hook [3 0 0 :completion company nil nil] ...] 4)
  load("/Users/abdellah/.emacs.d/.local/etc/@/init.28.elc" noerror nomessage nosuffix)
  (progn (load init-file-name 'noerror 'nomessage 'nosuffix))
  (if init-file-name (progn (load init-file-name 'noerror 'nomessage 'nosuffix)))
  (let ((init-file-name (file-name-concat doom-profile-dir (format "init.%d.elc" emacs-major-version)))) (setq user-init-file t) (if init-file-name (progn (load init-file-name 'noerror 'nomessage 'nosuffix))) (if (eq user-init-file t) (progn (signal 'doom-nosync-error (list init-file-name)))) (setq user-init-file (concat (string-remove-suffix ".elc" user-init-file) ".el")))
  (progn (let ((init-file-name (file-name-concat doom-profile-dir (format "init.%d.elc" emacs-major-version)))) (setq user-init-file t) (if init-file-name (progn (load init-file-name 'noerror 'nomessage 'nosuffix))) (if (eq user-init-file t) (progn (signal 'doom-nosync-error (list init-file-name)))) (setq user-init-file (concat (string-remove-suffix ".elc" user-init-file) ".el"))))
  (if init-file-user (progn (let ((init-file-name (file-name-concat doom-profile-dir (format "init.%d.elc" emacs-major-version)))) (setq user-init-file t) (if init-file-name (progn (load init-file-name 'noerror 'nomessage 'nosuffix))) (if (eq user-init-file t) (progn (signal 'doom-nosync-error (list init-file-name)))) (setq user-init-file (concat (string-remove-suffix ".elc" user-init-file) ".el")))))
  (condition-case error (if init-file-user (progn (let ((init-file-name (file-name-concat doom-profile-dir (format "init.%d.elc" emacs-major-version)))) (setq user-init-file t) (if init-file-name (progn (load init-file-name 'noerror 'nomessage 'nosuffix))) (if (eq user-init-file t) (progn (signal 'doom-nosync-error (list init-file-name)))) (setq user-init-file (concat (string-remove-suffix ".elc" user-init-file) ".el"))))) ((debug error) (display-warning 'initialization (format-message "An error occurred while loading `%s':\n\n%s%s%s\n\nTo ..." user-init-file (get (car error) 'error-message) (if (cdr error) ": " "") (mapconcat #'(lambda (s) (prin1-to-string s t)) (cdr error) ", ")) :warning) (setq init-file-had-error t)))
  (let ((debug-on-error debug-on-error-initial)) (condition-case error (if init-file-user (progn (let ((init-file-name (file-name-concat doom-profile-dir ...))) (setq user-init-file t) (if init-file-name (progn (load init-file-name ... ... ...))) (if (eq user-init-file t) (progn (signal ... ...))) (setq user-init-file (concat (string-remove-suffix ".elc" user-init-file) ".el"))))) ((debug error) (display-warning 'initialization (format-message "An error occurred while loading `%s':\n\n%s%s%s\n\nTo ..." user-init-file (get (car error) 'error-message) (if (cdr error) ": " "") (mapconcat #'(lambda ... ...) (cdr error) ", ")) :warning) (setq init-file-had-error t))) (or (eq debug-on-error debug-on-error-initial) (setq debug-on-error-should-be-set t debug-on-error-from-init-file debug-on-error)))
  (let ((debug-on-error-from-init-file nil) (debug-on-error-should-be-set nil) (debug-on-error-initial (if (eq init-file-debug t) 'startup init-file-debug)) (inhibit-null-byte-detection t)) (let ((debug-on-error debug-on-error-initial)) (condition-case error (if init-file-user (progn (let ((init-file-name ...)) (setq user-init-file t) (if init-file-name (progn ...)) (if (eq user-init-file t) (progn ...)) (setq user-init-file (concat ... ".el"))))) ((debug error) (display-warning 'initialization (format-message "An error occurred while loading `%s':\n\n%s%s%s\n\nTo ..." user-init-file (get (car error) 'error-message) (if (cdr error) ": " "") (mapconcat #'... (cdr error) ", ")) :warning) (setq init-file-had-error t))) (or (eq debug-on-error debug-on-error-initial) (setq debug-on-error-should-be-set t debug-on-error-from-init-file debug-on-error))) (if debug-on-error-should-be-set (progn (setq debug-on-error debug-on-error-from-init-file))))
  startup--load-user-init-file@init-doom(#f(compiled-function () #<bytecode -0x14938fa85c06b4f>) #f(compiled-function () #<bytecode -0x1f3c686ddc0d6275>) t)
  apply(startup--load-user-init-file@init-doom (#f(compiled-function () #<bytecode -0x14938fa85c06b4f>) #f(compiled-function () #<bytecode -0x1f3c686ddc0d6275>) t))
  startup--load-user-init-file(#f(compiled-function () #<bytecode -0x14938fa85c06b4f>) #f(compiled-function () #<bytecode -0x1f3c686ddc0d6275>) t)
  command-line()
  normal-top-level()

Any idea what's going on and how I can fix it?

Side note: Thank you so much for this amazing project. Finally, I'll be able to hack emacs without having to learn elisp ^^' + the ability to use js libraries. Super cool 👍

emacs -Q for compare test

I'll trying reproducing in plain emacs -Q and get back to you 👍

It worked in emacs -Q. Thanks for the tip.

Now, I'm trying with doom emacs to see what's wrong 🤔

when running the example in doom emacs (after init), the first time it complains but the second time it works properly.

Here is a screencast

doom_deno.mov

And even in emacs -Q, a similar thing (though not the same error) happens

emacs-q.mov

You need use (deno-bridge-start "demo" deno-bridge-demo-ts-path) start deno process.

Then call (deno-bridge-call "demo" "ping" "Hello from Emacs.") after deno process start.