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

Cannot launch (error in process filter) #208

Open
euporos opened this issue May 7, 2019 · 10 comments
Open

Cannot launch (error in process filter) #208

euporos opened this issue May 7, 2019 · 10 comments

Comments

@euporos
Copy link

euporos commented May 7, 2019

Hi there,

I'm completely new to JavaScript (albeit a seasones Emacs User) so I have followed the doc to the letter and I have also tried tried the tutorial at emacs café. Still chances are I am missing something obvious that is implicitly presupposed in the docs.

When I try to launch indium from the .indium.json file all I get is:

error in process filter: list: Wrong type argument: arrayp, data
error in process filter: Wrong type argument: arrayp, data

I have no clue what function is concerned here and thus how to troubleshoot this.

Further info:

Running GNU Emacs 26.2 on ubuntu 18.04
chromium-browser version: 73.0.3683.86
node version: v8.10.0

running indium in ther terminal seems to be working

$ indium 3000
Indium server listening on 3000

browsing http://localhost:3000/ however shows:

{"type":"error","payload":{"error":"Invalid JSON data received: \"GET / HTTP/1.1\r\nHost: localhost:3000\r\nUser-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:66.0) Gecko/20100101 Firefox/66.0\r\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\nAccept-Language: en-US,en;q=0.5\r\nAccept-Encoding: gzip, deflate\r\nConnection: keep-alive\r\nUpgrade-Insecure-Requests: 1\r\nIf-None-Match: W/\"490-oOzqPsxbfo/frtrTdkwsp3E/NZw\"\r\n\r\n\""}}

Any help will be greatly appreciated; for now I am stuck experimenting directly in the chrome console. Would love to get a REPL.

Many thanks in advance!

Oliver

@NicolasPetton
Copy link
Owner

Hi!

Could you paste your .indium.json file here please?

@NicolasPetton
Copy link
Owner

@Phylax-Aranatis I need more info to help you with this issue. Could you paste your .indium.json configuration file?

@NicolasPetton
Copy link
Owner

@Phylax-Aranatis you should not start the indium server manually like this.

Instead, run M-x indium-launch from within Emacs, or M-x indium-connect.

@euporos
Copy link
Author

euporos commented Aug 24, 2019

Hi there,

my apologies for not getting back to you… Especially after you've tried three times… many thanks for that. I've tried another approach since and somehow lost track of this issue.

I have now taken another swing at Indium though and the problem persists. The error message above (filter…) is the result of M-x indium-launch as well as M-x indium-connect. It was only for troubleshooting purposes that I tried to start the indium server manually to make sure it was properly installed.

I have google chrome and chromium on my system so I've tried with indium-chrome-executable set to google-chrome and chromium-browser – neither made any difference.

My .indium.json is minimalistic:

{
    "configurations": [
	{"name": "DOM_experiments",
	 "type": "chrome",
	 "url" : "/path/to/local/page.html"
	}
    ]
}

The defaults for the remaining settings seemed fine to me, so i didn't set host or port.

Still I have no clue as to what may be the problem… As I said it's likely something basic since I still don't know all that much about the underlying technologies.

Many thanks again! (I promise I'll answer promptly this time)

Oliver

@euporos
Copy link
Author

euporos commented Sep 3, 2019

Hi,
I've now tried launching with error-on-debug set to t. Here's what I get:

Debugger entered--Lisp error: (wrong-type-argument arrayp data)
  nreverse(data)
  (list (quote let) (nreverse alist) code)
  (lambda (alist code) (list (quote let) (nreverse alist) code))(data (pcase \.type ("error" (indium-client--handle-error \.payload)) ("success" (indium-client--handle-response \.id \.payload)) ("notification" (indium-client--handle-notification \.payload)) ("log" (indium-client--handle-log \.payload))))
  (let-alist data (pcase \.type ("error" (indium-client--handle-error \.payload)) ("success" (indium-client--handle-response \.id \.payload)) ("notification" (indium-client--handle-notification \.payload)) ("log" (indium-client--handle-log \.payload))))
  indium-client--handle-message(((id . 4) (type . "error") (payload (error . "Unexpected string in JSON at position 76"))))
  (progn (indium-client--handle-message data) (indium-client--handle-data buffer))
  (if data (progn (indium-client--handle-message data) (indium-client--handle-data buffer)))
  (let ((data)) (save-current-buffer (set-buffer buffer) (if (indium-client--complete-message-p) (progn (save-excursion (goto-char (point-min)) (setq data (json-read)) (delete-region (point-min) (point)) (delete-char 1))))) (if data (progn (indium-client--handle-message data) (indium-client--handle-data buffer))))
  indium-client--handle-data(#<buffer  indium-client-conn >)
  (let ((buf (process-buffer process))) (save-current-buffer (set-buffer buf) (save-excursion (goto-char (point-max)) (insert output))) (indium-client--handle-data buf))
  indium-client--connection-filter(#<process indium> "{\"id\":4,\"type\":\"error\",\"payload\":{\"error\":\"Unexpected string in JSON at position 76\"}}\n")

To me the message seems to reflect the error message I quoted in my first post, namely that browsing http://localhost:3000/ shows:

{"type":"error","payload":{"error":"Invalid JSON data received: \"GET / HTTP/1.1\r\nHost: localhost:3000\r\nUser-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:66.0) Gecko/20100101 Firefox/66.0\r\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\nAccept-Language: en-US,en;q=0.5\r\nAccept-Encoding: gzip, deflate\r\nConnection: keep-alive\r\nUpgrade-Insecure-Requests: 1\r\nIf-None-Match: W/\"490-oOzqPsxbfo/frtrTdkwsp3E/NZw\"\r\n\r\n\""}} 

At least both are talking about payload.… Maybe this helps tracking down the issue.

Many thanks and all the best

Oliver

@NicolasPetton
Copy link
Owner

Thanks for the detailed report. I won't have time to look at it until next week, but I'll get back to you as soon as I have.

@euporos
Copy link
Author

euporos commented Sep 6, 2019

Thanks for getting back to me (and not being salty about my long silence)… looking forward to hearing from you!

@NicolasPetton
Copy link
Owner

Hi @Phylax-Aranatis, I'm trying to reproduce your issue, but unfortunately I cannot.

In your .indium.json configuration, it looks like you're launching Chrome on a local HTML file using the file:// protocol? Or am I misunderstanding?

@euporos
Copy link
Author

euporos commented Oct 31, 2019

Hi, many thanks for getting back to me.

I have tried both, local file and my local XAMPP, i.e. putting the following in the indium.json:

"/absolute/path/to/page.html"
"file:///absolute/path/to/page.html"
"localhost/page.html"
"http://localhost/page.html"

All yield the same error.

On a personal note: My way through web development has now taken a somewhat different path and I don't find myself coding JS directly all that often anymore… I do the vast majority in ClojureScript so getting indium to work has become way less urgent for me personally than it was when I first asked the question… so in case my problem is very specific to my setup, there's probably no need for you to invest a lot of time into it.

Many thanks again

Oliver

@NicolasPetton
Copy link
Owner

NicolasPetton commented Oct 31, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants