GithubHelp home page GithubHelp logo

Nodejs issue about copilot.el HOT 9 CLOSED

copilot-emacs avatar copilot-emacs commented on August 27, 2024
Nodejs issue

from copilot.el.

Comments (9)

zerolfx avatar zerolfx commented on August 27, 2024 1

It seems make-instance or make-process failed, which caused copilot--connection to become nil.

Can you open a new issue?
Also, please attach relative stuff in *Message*, *copilot stderr* and *copilot event*?

from copilot.el.

zerolfx avatar zerolfx commented on August 27, 2024

It is an upstream problem. See https://github.com/github/copilot.vim#getting-started

I will update as soon as copilot.vim supports NodeJS v18+.

from copilot.el.

zerolfx avatar zerolfx commented on August 27, 2024

Workaround: install node.js v17 via nvm, and set the copilot-node-executable variable to that executable.

from copilot.el.

zerolfx avatar zerolfx commented on August 27, 2024

I tested with node.js 18, and it works fine. So I remove the node version restriction from the code (though the upstream still indicates it as unsupported).

#18 (comment)

I confirmed that node.js 18 will still cause the plugin unusable on python, go, js files.

from copilot.el.

maurelio1234 avatar maurelio1234 commented on August 27, 2024

I have the same problem with Node 18.1:

I got that after copilot-login:

Node 18+ is not supported but found 18.1
cl-no-applicable-method: No applicable method: jsonrpc--next-request-id, nil

from copilot.el.

zerolfx avatar zerolfx commented on August 27, 2024

@maurelio1234 Node 18 is unsupported, please see the workaround below.

Workaround: install node.js v17 via nvm, and set the copilot-node-executable variable to that executable.

from copilot.el.

maurelio1234 avatar maurelio1234 commented on August 27, 2024

Thanks,
It fixed the first line, but I still get the second one:

cl-no-applicable-method: No applicable method: jsonrpc--request-continuations, nil

from copilot.el.

zerolfx avatar zerolfx commented on August 27, 2024

@maurelio1234 Can you use M-x toggle-debug-on-error and provide the stack trace?

from copilot.el.

maurelio1234 avatar maurelio1234 commented on August 27, 2024

Yes, I was trying to debug it... but I am still a bit lost on the calls.

  signal(cl-no-applicable-method (jsonrpc--next-request-id nil))
  cl-no-applicable-method(#s(cl--generic :name jsonrpc--next-request-id :dispatches ((0 #s(cl--generic-generalizer :name eieio--generic-generalizer :priority 50 :tagcode-function cl--generic-struct-tag :specializers-function #f(compiled-function (tag &rest _) #<bytecode 0x7c0fe02c20e345f>)) #s(cl--generic-generalizer :name cl--generic-t-generalizer :priority 0 :tagcode-function #f(compiled-function (name &rest _) #<bytecode -0x1cba9713a96764e4>) :specializers-function #f(compiled-function (tag &rest _) #<bytecode -0x2b7bed08469105e>)))) :method-table (#s(cl--generic-method :specializers (jsonrpc-connection) :qualifiers nil :uses-cnm nil :function #f(compiled-function (this) "Retrieve the slot `-next-request-id' from an object of class\n`jsonrpc-connection'." #<bytecode -0xdffd8319754bae5>))) :options nil) nil)
  apply(cl-no-applicable-method #s(cl--generic :name jsonrpc--next-request-id :dispatches ((0 #s(cl--generic-generalizer :name eieio--generic-generalizer :priority 50 :tagcode-function cl--generic-struct-tag :specializers-function #f(compiled-function (tag &rest _) #<bytecode 0x7c0fe02c20e345f>)) #s(cl--generic-generalizer :name cl--generic-t-generalizer :priority 0 :tagcode-function #f(compiled-function (name &rest _) #<bytecode -0x1cba9713a96764e4>) :specializers-function #f(compiled-function (tag &rest _) #<bytecode -0x2b7bed08469105e>)))) :method-table (#s(cl--generic-method :specializers (jsonrpc-connection) :qualifiers nil :uses-cnm nil :function #f(compiled-function (this) "Retrieve the slot `-next-request-id' from an object of class\n`jsonrpc-connection'." #<bytecode -0xdffd8319754bae5>))) :options nil) nil)
  #f(compiled-function (&rest args) #<bytecode 0x34ead4d00f21edf>)(nil)
  apply(#f(compiled-function (&rest args) #<bytecode 0x34ead4d00f21edf>) nil nil)
  jsonrpc--next-request-id(nil)
  jsonrpc--async-request-1(nil signInInitiate 'nil :success-fn #f(compiled-function (result) #<bytecode -0x158b5a5a62aebec4>) :error-fn #f(compiled-function (jsonrpc-lambda-elem0) #<bytecode -0x12137907ed4b628b>) :timeout-fn #f(compiled-function () #<bytecode -0x1ff562e9dcbb93b8>))
  apply(jsonrpc--async-request-1 nil signInInitiate 'nil :success-fn #f(compiled-function (result) #<bytecode -0x158b5a5a62aebec4>) :error-fn #f(compiled-function (jsonrpc-lambda-elem0) #<bytecode -0x12137907ed4b628b>) :timeout-fn #f(compiled-function () #<bytecode -0x1ff562e9dcbb93b8>) nil)
  jsonrpc-request(nil signInInitiate 'nil)
  (let ((input0 (jsonrpc-request copilot--connection 'signInInitiate ''nil))) (let* ((status (plist-get input0 :status)) (user (plist-get input0 :user)) (user-code (plist-get input0 :userCode)) (verification-uri (plist-get input0 :verificationUri))) (if (s-equals-p status "AlreadySignedIn") (progn (message "Already signed in as %s." user) (throw '--cl-block-copilot-login-- nil))) (if (display-graphic-p) (progn (gui-set-selection 'CLIPBOARD user-code) (read-from-minibuffer (format "Your one-time code %s is copied. Press ENTER to op..." user-code)) (browse-url verification-uri) (read-from-minibuffer "Press ENTER if you finish authorizing.")) (read-from-minibuffer (format "First copy your one-time code: %s. Press ENTER to ..." user-code)) (read-from-minibuffer (format "Please open %s in your browser. Press ENTER if you..." verification-uri))) (message "Verifying...") (condition-case err (jsonrpc-request copilot--connection 'signInConfirm (list :userCode user-code)) (jsonrpc-error (message "Authentication failure: %s" (alist-get 'jsonrpc-error-message (cdr (cdr err)))))) (let ((input0 (jsonrpc-request copilot--connection 'checkStatus ''nil))) (let* ((status (plist-get input0 :status)) (user (plist-get input0 :user))) (if (s-equals-p status "NoTelemetryConsent") (progn (if (yes-or-no-p "I agree to these telemetry terms as part of the Gi...") (jsonrpc-request copilot--connection ... ...) (throw ... nil)))) (message "Authenticated as GitHub user %s." user)))))
  (catch '--cl-block-copilot-login-- (let ((input0 (jsonrpc-request copilot--connection 'signInInitiate ''nil))) (let* ((status (plist-get input0 :status)) (user (plist-get input0 :user)) (user-code (plist-get input0 :userCode)) (verification-uri (plist-get input0 :verificationUri))) (if (s-equals-p status "AlreadySignedIn") (progn (message "Already signed in as %s." user) (throw '--cl-block-copilot-login-- nil))) (if (display-graphic-p) (progn (gui-set-selection 'CLIPBOARD user-code) (read-from-minibuffer (format "Your one-time code %s is copied. Press ENTER to op..." user-code)) (browse-url verification-uri) (read-from-minibuffer "Press ENTER if you finish authorizing.")) (read-from-minibuffer (format "First copy your one-time code: %s. Press ENTER to ..." user-code)) (read-from-minibuffer (format "Please open %s in your browser. Press ENTER if you..." verification-uri))) (message "Verifying...") (condition-case err (jsonrpc-request copilot--connection 'signInConfirm (list :userCode user-code)) (jsonrpc-error (message "Authentication failure: %s" (alist-get 'jsonrpc-error-message (cdr ...))))) (let ((input0 (jsonrpc-request copilot--connection 'checkStatus '...))) (let* ((status (plist-get input0 :status)) (user (plist-get input0 :user))) (if (s-equals-p status "NoTelemetryConsent") (progn (if ... ... ...))) (message "Authenticated as GitHub user %s." user))))))
  (closure (t) nil "Login to Copilot." (interactive) (catch '--cl-block-copilot-login-- (let ((input0 (jsonrpc-request copilot--connection 'signInInitiate ''nil))) (let* ((status (plist-get input0 :status)) (user (plist-get input0 :user)) (user-code (plist-get input0 :userCode)) (verification-uri (plist-get input0 :verificationUri))) (if (s-equals-p status "AlreadySignedIn") (progn (message "Already signed in as %s." user) (throw '--cl-block-copilot-login-- nil))) (if (display-graphic-p) (progn (gui-set-selection 'CLIPBOARD user-code) (read-from-minibuffer (format "Your one-time code %s is copied. Press ENTER to op..." user-code)) (browse-url verification-uri) (read-from-minibuffer "Press ENTER if you finish authorizing.")) (read-from-minibuffer (format "First copy your one-time code: %s. Press ENTER to ..." user-code)) (read-from-minibuffer (format "Please open %s in your browser. Press ENTER if you..." verification-uri))) (message "Verifying...") (condition-case err (jsonrpc-request copilot--connection 'signInConfirm (list :userCode user-code)) (jsonrpc-error (message "Authentication failure: %s" (alist-get ... ...)))) (let ((input0 (jsonrpc-request copilot--connection ... ...))) (let* ((status ...) (user ...)) (if (s-equals-p status "NoTelemetryConsent") (progn ...)) (message "Authenticated as GitHub user %s." user)))))))()
  apply((closure (t) nil "Login to Copilot." (interactive) (catch '--cl-block-copilot-login-- (let ((input0 (jsonrpc-request copilot--connection 'signInInitiate '...))) (let* ((status (plist-get input0 :status)) (user (plist-get input0 :user)) (user-code (plist-get input0 :userCode)) (verification-uri (plist-get input0 :verificationUri))) (if (s-equals-p status "AlreadySignedIn") (progn (message "Already signed in as %s." user) (throw ... nil))) (if (display-graphic-p) (progn (gui-set-selection ... user-code) (read-from-minibuffer ...) (browse-url verification-uri) (read-from-minibuffer "Press ENTER if you finish authorizing.")) (read-from-minibuffer (format "First copy your one-time code: %s. Press ENTER to ..." user-code)) (read-from-minibuffer (format "Please open %s in your browser. Press ENTER if you..." verification-uri))) (message "Verifying...") (condition-case err (jsonrpc-request copilot--connection 'signInConfirm (list :userCode user-code)) (jsonrpc-error (message "Authentication failure: %s" ...))) (let ((input0 ...)) (let* (... ...) (if ... ...) (message "Authenticated as GitHub user %s." user))))))) nil)
* copilot-login()
  funcall-interactively(copilot-login)
  call-interactively(copilot-login record nil)
  command-execute(copilot-login record)
  counsel-M-x-action("copilot-login")
  ivy-call()
  ivy-read("M-x " [org-capture-goto-last-stored magit-section-show-headings log-edit-remember-comment timer-next-integral-multiple-of-time archive-proper-file-start tramp-completion-handle-file-name-all-completions archive--file-desc-mode straight-vc-clone backquote-listify verification-uri ert-test-passed-duration--cmacro c-electric-lt-gt pcomplete-stub japanese-hiragana-two-byte cc-vars &error link-name magit-xref-insert-button 0 f-ancestor-of\? files--splice-dirname-file deft-hash-summaries message-expand-name-databases transient:magit-diff-refresh:--irreversible-delete autoload-find-file copilot-login flycheck-coffee-coffeelint-executable magit-list-modified-modules kmacro-pop-ring1 mu4e-cited-7-face browse-url-gnome-moz-arguments flycheck-pug-executable dircolors-face-ps xref--push-markers 0 event-convert-list 0 edconf-custom-hooks int-file-name kmacro-p use-package-handler/:interpreter magit-filename flycheck-previous-error server--on-display-p zoo Futura xref-group tsc-node-named-p tramp-handle-make-auto-save-file-name puny-encode-digit ...] :predicate #f(compiled-function (sym) #<bytecode -0x802b1d6cde289c9>) :require-match t :history counsel-M-x-history :action counsel-M-x-action :keymap (keymap (67108908 . counsel--info-lookup-symbol) (67108910 . counsel-find-symbol)) :initial-input "" :caller counsel-M-x)
  counsel-M-x("")
  me/counsel-M-x()
  funcall-interactively(me/counsel-M-x)
  call-interactively(me/counsel-M-x nil nil)
  command-execute(me/counsel-M-x)

from copilot.el.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.