alxhotel / chromecast-api

:tv: Chromecast Node.js module
MIT License
155 stars 49 forks source link

Uncaught Error: illegal token '<' (/cast_channel.proto, line 1) #47

Closed lukasdebeerst closed 4 years ago

lukasdebeerst commented 4 years ago

When I import the chromecast-api into my react-app, I get this message: Uncaught Error: illegal token '<' (/cast_channel.proto, line 1) Can you help me the solve it?

Also when I implement the rest of your code I got another error: TypeError: dgram.createSocket is not a function push../node_modules/multicast-dns/index.js.module.exports node_modules/multicast-dns/index.js:25

I would appreciatie it if you could help me :)

alxhotel commented 4 years ago

Hi @lukasdebeerst,

The chromecast-api library is meant to run on NodeJS, not on the browser. This is because the library uses (as you point out) some dependencies like dgram which can not be run in the browser.

If you want to run something on the chromecast from the browser I think you need to use an official SDK from Google. Not sure about this (maybe there are other libraries that support browser).

Also if someone knows how to add support for browser let me know.

lukasdebeerst commented 4 years ago

Ok, I will check it out. thank you!