Skip to content
This repository has been archived by the owner on Jul 22, 2020. It is now read-only.

"Internal error TypeError Alerts is undefined" #143

Closed
carlpett opened this issue Jul 14, 2017 · 11 comments
Closed

"Internal error TypeError Alerts is undefined" #143

carlpett opened this issue Jul 14, 2017 · 11 comments
Labels

Comments

@carlpett
Copy link

Unsee does not work on our dashboard TVs (running PlayIPP), with the error message "Internal error TypeError Alerts is undefined". Any idea what would cause this? Just poor javascript support in the box?

@prymitive
Copy link
Contributor

TypeErrors like these are usually caused by modules failed to load, most likely due to an error while parsing JS code.
Sentry would be able to answer this question better than me (developer console could also have some hints), but I suspect that the browser doesn't modern javascript features and some of the modules used needs those, e.g. lru.js.
Are you able to collect any details?

@carlpett
Copy link
Author

Ok, signed up for a sentry trial.
Apparently the browser is FF 33.0. Not exactly new. As you guessed, there is some parsing error:

SyntaxError: missing ; before statement
ReferenceError: LRUMap is not defined

TypeError: Alerts is undefined
  at Unsee</triggerReload/<.success/<(/static/unsee.js:221:33)
  at d(/static/managed/js/3.15.0-raven.min.js:2:6300)

So this is basically unfixable without getting the vendor to update the browser?

@prymitive
Copy link
Contributor

I'll look into it in a few days. Need to verify how much LRU really helps and whenever it can be reimplemented using something that older browsers would support. No promises but it should be fixable, assuming that's the only code that tv is having problems with. Thanks

@prymitive
Copy link
Contributor

Can you try lru.js-v2 branch and see if that helps?

The easiest way would be to build a custom docker image from that branch using:

git clone https://github.com/cloudflare/unsee.git
cd unsee
git checkout lru.js-v2 
make docker-image
make run-docker

make run-docker will spawn a test instance that uses mock data, but it should be enough to do a test.
Let me know if that's enough to fix this issue.

@carlpett
Copy link
Author

@prymitive Thanks! I've built the image and pushed it to our internal repos now, however I'm not in the office today so I cannot validate how it looks on the actual screens today. I'll post an update as soon as I'm back!

@carlpett
Copy link
Author

@prymitive Yes, it works!

@prymitive
Copy link
Contributor

Raised #147 to merge it

@prymitive
Copy link
Contributor

Released 0.7.1 with that PR merged, please use that release.

@carlpett
Copy link
Author

Thanks!

@prymitive
Copy link
Contributor

ps. you should still ping the vendor to update the browser, 13-Oct-2015 was a long time ago

@prymitive
Copy link
Contributor

Browser caching was causing errors with new version of lru.js, I've tagged 0.7.2 with a small fix.

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

No branches or pull requests

2 participants