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

Execution error #10

Closed
outaTiME opened this issue Feb 23, 2015 · 31 comments
Closed

Execution error #10

outaTiME opened this issue Feb 23, 2015 · 31 comments
Assignees
Labels

Comments

@outaTiME
Copy link
Contributor

Hi pal,

When i run the comman i get the following error:

$ crconsole 
https://www.google.com.ar/?gfe_rd=cr&ei=nqPrVNtH04CpBbusgKAC&gws_rd=ssl
www.google.com.ar> repl.js:400
  this.prompt(preserveCursor);
       ^
TypeError: string is not a function
    at REPLServer.displayPrompt (repl.js:400:8)
    at null.<anonymous> (/usr/local/lib/node_modules/crconsole/index.js:256:17)
    at emit (events.js:104:17)
    at EventEmitter.<anonymous> (/usr/local/lib/node_modules/crconsole/node_modules/chrome-remote-interface/index.js:54:48)
    at EventEmitter.emit (events.js:107:17)
    at WebSocket.<anonymous> (/usr/local/lib/node_modules/crconsole/node_modules/chrome-remote-interface/lib/chrome.js:114:23)
    at WebSocket.emit (events.js:104:17)
    at WebSocket.establishConnection (/usr/local/lib/node_modules/crconsole/node_modules/chrome-remote-interface/node_modules/ws/lib/WebSocket.js:714:8)
    at ClientRequest.<anonymous> (/usr/local/lib/node_modules/crconsole/node_modules/chrome-remote-interface/node_modules/ws/lib/WebSocket.js:627:25)
    at ClientRequest.g (events.js:199:16)

im running node 0.12 version on macos

@sidorares
Copy link
Owner

thanks, I can reproduce it. I was using undocumented repl.prompt() and it seems that API has changed

@sidorares sidorares self-assigned this Feb 24, 2015
@sidorares sidorares added the bug label Feb 24, 2015
@sidorares
Copy link
Owner

iojs and 0.12 only - 0.10 does not give error. On it

@fakedrake
Copy link

+1

@sidorares
Copy link
Owner

hm, I thought I fixed this

@sidorares
Copy link
Owner

oh, that was sidorares/node-vim-debugger#17

@sidorares
Copy link
Owner

same fix should apply here. I'll try to fix tomorrow unless you can try before me @outaTiME @fakedrake

@sidorares
Copy link
Owner

published as v1.0.0

@outaTiME
Copy link
Contributor Author

Hi pal,

Now it works but i get a new error, here the stack:

$ crconsole
http://localhost:9000/desktop/dashboard.html
url.js:110
    throw new TypeError("Parameter 'url' must be a string, not " + typeof url)
          ^
TypeError: Parameter 'url' must be a string, not undefined
    at Url.parse (url.js:110:11)
    at Object.urlParse [as parse] (url.js:104:5)
    at WebSocket.initAsClient (/usr/local/lib/node_modules/crconsole/node_modules/chrome-remote-interface/node_modules/ws/lib/WebSocket.js:475:23)
    at new WebSocket (/usr/local/lib/node_modules/crconsole/node_modules/chrome-remote-interface/node_modules/ws/lib/WebSocket.js:59:18)
    at Chrome.connectToWebSocket (/usr/local/lib/node_modules/crconsole/node_modules/chrome-remote-interface/lib/chrome.js:131:15)
    at Object.ChromeREPL.setTab (/usr/local/lib/node_modules/crconsole/index.js:236:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/crconsole/index.js:23:12)
    at /usr/local/lib/node_modules/crconsole/index.js:172:7
    at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/crconsole/node_modules/chrome-remote-interface/lib/chrome.js:123:13)
    at IncomingMessage.emit (events.js:129:20)

something wired, here nooup ??

thks !!

@sidorares
Copy link
Owner

can't reproduce. What is your chrome version?

Could you add console.log(tab) before https://github.com/sidorares/crconsole/blob/master/index.js#L236 ? For some reason webSocketDebuggerUrl property is not set for you

@outaTiME
Copy link
Contributor Author

Hi pal, there my chrome version:

screen shot 2015-04-29 at 22 30 49

i could try, give me few minutes ...

@outaTiME
Copy link
Contributor Author

yay, im clone the repo and running locally ...

the '>>>' are console.log('>>>', tab); in:

https://github.com/sidorares/crconsole/blob/master/index.js#L236

here the trace:

[0] chrome-devtools://devtools/bundled/devtools.html?&can_dock=true&dockSide=undocked&toolbarColor=rgba(230,230,230,1)&textColor=rgba(0,0,0,1)
[1] chrome-devtools://devtools/bundled/toolbox.html?&can_dock=true&dockSide=undocked&toolbarColor=rgba(230,230,230,1)&textColor=rgba(0,0,0,1)
[2] http://localhost:9000/desktop/dashboard.html
[3] https://github.com/sidorares/crconsole
[4] chrome-extension://pafkbggdmjlpgkdkcbjmhmfcdpncadgh/_generated_background_page.html
[5] chrome-extension://onhbegdkgonhlokobjefolhpoidcnida/background.html
[6] chrome-extension://jnihajbhpnppcggbcgedagnkighmdlei/_generated_background_page.html
[7] chrome-extension://gmlllbghnfkpflemihljekbapjopfjik/_generated_background_page.html
[8] chrome-extension://cjpalhdlnbpafiamejdnhcphjbkeiagm/background.html
[9] chrome-extension://chklaanhfefbnpoihckbnefhakgolnmc/_generated_background_page.html
[10] chrome-extension://aomjjhallfgjeglblehebfpbcfeobpgk/_generated_background_page.html
[11] https://docs.google.com/offline/backgroundshell#ouid=u1b9d54c15874ee64
[12] https://docs.google.com/fe/s/fe.s.ClientModule.nocache.js?ouid=u1b9d54c15874ee64
localhost> .switch 2
>>> { description: '',
  faviconUrl: 'http://localhost:9000/skyweb/assets/images/favicon.png?_swc=1430320877323',
  id: '79F92A9E-09A4-4D42-AECA-8175874B4C7A',
  title: 'Dashboard',
  type: 'page',
  url: 'http://localhost:9000/desktop/dashboard.html' }
url.js:110
    throw new TypeError("Parameter 'url' must be a string, not " + typeof url)
          ^
TypeError: Parameter 'url' must be a string, not undefined
    at Url.parse (url.js:110:11)
    at Object.urlParse [as parse] (url.js:104:5)
    at WebSocket.initAsClient (/Users/outaTiME/Code/crconsole/node_modules/chrome-remote-interface/node_modules/ws/lib/WebSocket.js:475:23)
    at new WebSocket (/Users/outaTiME/Code/crconsole/node_modules/chrome-remote-interface/node_modules/ws/lib/WebSocket.js:59:18)
    at Chrome.connectToWebSocket (/Users/outaTiME/Code/crconsole/node_modules/chrome-remote-interface/lib/chrome.js:131:15)
    at Object.ChromeREPL.setTab (/Users/outaTiME/Code/crconsole/index.js:237:17)
    at Object.<anonymous> (/Users/outaTiME/Code/crconsole/index.js:359:14)
    at IncomingMessage.<anonymous> (/Users/outaTiME/Code/crconsole/node_modules/chrome-remote-interface/lib/chrome.js:123:13)
    at IncomingMessage.emit (events.js:129:20)
    at _stream_readable.js:908:16

@sidorares
Copy link
Owner

ok, I think I know what is the problem. You already have devtools open and chrome does not allow to connect external client ( that's why your tab is missing webSocketDebuggerUrl ). Close devtools and try again

Probably need to add better error handling for this

@outaTiME
Copy link
Contributor Author

mmm, but i like to display the output in developer tools in crconsole, its not possible ??

@sidorares
Copy link
Owner

you can try to use https://github.com/sidorares/crmux

@outaTiME
Copy link
Contributor Author

mmm, i trying crmux ... but i want to display the developer tools output in my terminal not in a remote window it could be possible ??

@sidorares
Copy link
Owner

Which output? console messages are redirected back to terminal, you should be able to see them

@outaTiME
Copy link
Contributor Author

with the crmux ??

There is my scenario:

  1. Running app in localhost.
  2. App generate output in dev tools console (console.log)
  3. I want to show this log (the dev tools console) in terminal.

Which is the step by step to perform this ?? maybe i doing something wrong ...

thks!

@sidorares
Copy link
Owner

no, you don't need crmux. Just attach crconsole (make sure there is no devtools attached )
messages should automatically appear in your crconsole session. No extra steps required

@outaTiME
Copy link
Contributor Author

mmmm, but only displays the console.log not all messages right ???

i got a lot of console.info and these data not shown =( it possible ??

@outaTiME
Copy link
Contributor Author

the console output not are really identically =(

@sidorares
Copy link
Owner

You are right, it's ignored - the code is here https://github.com/sidorares/crconsole/blob/master/index.js#L250

@outaTiME
Copy link
Contributor Author

ooups, some reason for that ?? our it will be updated ??

@sidorares
Copy link
Owner

not sure, probably no reason. Can you try to disable filtering? Just comment out https://github.com/sidorares/crconsole/blob/master/index.js#L250-L251

@outaTiME
Copy link
Contributor Author

jejeje, great ... i try to update the code locally and try ...

i give you my feedback if found any side effect ^^

thks !

@sidorares
Copy link
Owner

probably would be nice to display logs in different color based on the level

@outaTiME
Copy link
Contributor Author

yup, probably it will very usefull ... BTW if i comment the filtering all goes fine ... no exceptions ^^

but expressions in logs are not resolved =(

like:

[Platform.Desktop.Modules.Dashboard] Incoming message: %s record(s) updated in: %sms

@outaTiME
Copy link
Contributor Author

Some limitation in Chrome REPL ??

@sidorares
Copy link
Owner

can you post exactly your code which outputs log? Whith console.log('test') or console.info('test') I can see messages ( filtering is commented out )

@outaTiME
Copy link
Contributor Author

The simple logging works, but if you put something like:

console.log('Today is: %s', new Date())

the crconsole displays:

'Today is: %s'without the replacement, it understands ??

@sidorares
Copy link
Owner

yes, but you'll need to process parameters manually. Uncomment https://github.com/sidorares/crconsole/blob/master/index.js#L248 to see payload, it's in message.parameters

@sidorares
Copy link
Owner

added #13 to track progress

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

No branches or pull requests

3 participants