resoai / TileBoard

A simple yet highly configurable Dashboard for HomeAssistant
MIT License
1.63k stars 278 forks source link

window.CONFIG not defined? #689

Closed fatboy00 closed 3 years ago

fatboy00 commented 3 years ago

Hi There,

Apologies if this is a straightforward question problem: I am getting an error thrown from loading config.js. Browser warns me that

"The 'config.js' configuration file has loaded but window.CONFIG is not defined! Please make sure that it defines a CONFIG variable with proper configuration"

I am a newbie.
I just loaded version 2.3.0 of Tileboard.
I do get the nice green screen but with no writing.

Any help would be much appreciated.

Screenshot 2021-04-06 at 11 31 18
rchl commented 3 years ago

Once you "OK" this error, you should see a notification popup saying more precisely what the error is (possibly a syntax error in the config file).

fatboy00 commented 3 years ago

Thanks for the speedy response.

I have the following error: uncaught ReferencError: PASSWORD_TYPES is not defined

Screenshot 2021-04-06 at 12 25 53

Line 17/18 look like this:

passwordType: PASSWORD_TYPES.PROMPT_AND_SAVE, //password: null,

rchl commented 3 years ago

That says it all. There is no PASSWORD_TYPES defined anywhere unless you define it yourself somewhere in the config.js.

None of that code is from the example config so I'm not sure what are you trying to do there.

fatboy00 commented 3 years ago

Apologies - I am also not sure what it is supposed to accomplish. I was just following along from a youtube video.

https://www.youtube.com/watch?v=nPA1qvHNGl8

In the video, he uses something slightly different (PASSWORD_TYPES.MANUAL) but that throws the same error as above. From the overview section:

serverUrl: "http://10.10.10.5:8123​", wsUrl: "ws://10.10.10.5:8123/api/websocket", passwordType: PASSWORD_TYPES.MANUAL, password: "HassAPIpass",

I tried taking both lines out, but that doesn't appear to work either - I get an access token error and then (a few seconds later) page goes to 'site cannot be reached.'

Google seems to show that something needs to be put in here, but I'm not really grokking it.

Appreciate your patience.

rchl commented 3 years ago

That's something that was present in old versions of TileBoard but things have changes since then.

Just remove password and passwordType lines and an authentication page should show up where you would input your credentials.

BTW. Refer to the example config for what's supported - https://github.com/resoai/TileBoard/blob/master/config.example.js

fatboy00 commented 3 years ago

Sorry to bother you again, and it might be that this issue is closed and I have a new one.

I removed both lines as suggested. and I get the following error 'ACCESS TOKEN Error while receiving Access Token'. After a few seconds the screen goes to "this site cannot be reached".

I was thinking that I need a password in my configuration.yaml, but the documentation appears to suggest not (https://www.home-assistant.io/docs/authentication/providers/)

Thanks for any last hints.

Screenshot 2021-04-06 at 13 19 48 Screenshot 2021-04-06 at 13 15 47
rchl commented 3 years ago

TileBoard redirects to the OAuth HA page when the token is not saved.

The error page says "Check if there is a typo in homeassitant.local" and indeed there is. Missing "s" in homeassitant. Where does that domain come from, I'm not sure. Possibly somewhere in your HA configuration.yaml file.

fatboy00 commented 3 years ago

you solved it.

Lesson for me...get more accurate with typing!

Many thanks for your patience.