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

Uncaught TypeError: Cannot read property 'split' of undefined #59

Closed
TheAssassin opened this issue Mar 13, 2018 · 9 comments
Closed

Uncaught TypeError: Cannot read property 'split' of undefined #59

TheAssassin opened this issue Mar 13, 2018 · 9 comments
Assignees

Comments

@TheAssassin
Copy link
Member

Uncaught TypeError: Cannot read property 'split' of undefined
    at updateAllWithAPIData (web-api.js:44)

Just noticed this error after deploying the current state (merge of PR #58). I run Chromium Version 64.0.3282.167 on Ubuntu 16.04.

@TobiGr
Copy link
Contributor

TobiGr commented Mar 13, 2018

api.stats.changelog doesn't exist yet. That's the reason. And what FF says :) First time I saw that FF has better debugging than Chromium...

@TobiGr TobiGr closed this as completed Mar 13, 2018
@TobiGr
Copy link
Contributor

TobiGr commented Mar 13, 2018

Fix in 066f2f0

@TheAssassin
Copy link
Member Author

I see. Can you please request this feature in the web-api repo? I don't remember an issue about this.

@TheAssassin TheAssassin reopened this Mar 13, 2018
@TheAssassin
Copy link
Member Author

Uncaught SyntaxError: Unexpected token }

You commented a bit too fast.

@TobiGr
Copy link
Contributor

TobiGr commented Mar 13, 2018

The comment should've started one line above 😫

@TheAssassin
Copy link
Member Author

By the way, why are you using a synchronous request to query the API? I mean, you're using JQuery already anyway. You could simply use $.get(...) with a callback. Chromium shows warnings about it.

@TobiGr
Copy link
Contributor

TobiGr commented Mar 13, 2018

Yes that's right. I can changed it. The reason I didn't do it, is - AFAIK - that $(document).ready() functions are triggered asynchronously.

@TheAssassin
Copy link
Member Author

@TobiGr JavaScript code runs in a single thread. "Running asynchronously" doesn't mean it's run in another thread. The $(document).ready() callback is run in the same thread as well. Therefore, a synchronous request is always blocking this thread. If it's run asynchronously, the JavaScript interpreter will open the TCP port, send the request, and as soon as the JavaScript interpreter receives a response, it'll schedule the callback to be called next. There is definitely no parallelization. See https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Synchronous_and_Asynchronous_Requests.

@TobiGr
Copy link
Contributor

TobiGr commented Apr 10, 2018

I think we can close this as it is fixed.

@TobiGr TobiGr closed this as completed Apr 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants