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 make this work #9

Open
libussa opened this issue Dec 10, 2019 · 5 comments
Open

cannot make this work #9

libussa opened this issue Dec 10, 2019 · 5 comments

Comments

@libussa
Copy link

libussa commented Dec 10, 2019

hey, sorry if this seems basic, but I'm just starting with HS...
Running Docker, the js file is in /config/www
On top of the lovelace config I added:

resources:
  - url: /local/zha-network-visualization-card.js
    type: js

I then created a new view, with a card defined like this:

type: 'custom:zha-network-visualization-card'

The card says

Custom element doesn't exist: zha-network-visualization-card.
type: 'custom:zha-network-visualization-card'

And in the logs I have

2019-12-10 01:07:55 ERROR (MainThread) [frontend.js.latest.201911196] http://192.168.1.3:8123/local/zha-network-visualization-card.js:1:1 Uncaught SyntaxError: Cannot use import statement outside a module
2019-12-10 01:15:48 ERROR (MainThread) [frontend.js.latest.201911196] http://192.168.1.3:8123/local/zha-network-visualization-card.js:1:0 SyntaxError: import declarations may only appear at top level of a module

Thanks for the help!

@dmulcahey
Copy link
Owner

dmulcahey commented Dec 10, 2019

Type is module not js In your resources declaration

@libussa
Copy link
Author

libussa commented Dec 10, 2019

Thanks for the prompt response @dmulcahey ! I now get a white rectangle, progress!

I loaded https://github.com/zha-ng/zha-map and it looks like it get loaded at startup

2019-12-10 02:10:44 INFO (SyncWorker_4) [homeassistant.loader] Loaded zha_map from custom_components.zha_map

However, in logs I now get:

2019-12-10 02:11:16 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.140055236978128] Received invalid command: zha_map/devices

@dmulcahey
Copy link
Owner

That’s odd. You’re sure you have the newest version and that there are no errors in the logs?

@libussa
Copy link
Author

libussa commented Dec 10, 2019

This is the log from startup https://gist.githubusercontent.com/libussa/23fad788e0567d08b87fb75d21620efc/raw/604e6c0ae1d1f24ee51e4730cefc3b2f54fada8e/ha.log

both zha_map and this are from fresh clones of the master branch

@meremortals70
Copy link

I cannot make this work with the new integrations setup in HA.

Added through HACS.

Shows as added in Configuration>>Lovelace Dashboards>>Resources

/hacsfiles/zha-network-card/zha-network-card.js
JavaScript Module

However cannot add a card

Any thoughts please?

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

No branches or pull requests

3 participants