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

non-shared web-worker return references window #61

Closed
laforge49 opened this issue Feb 5, 2016 · 6 comments
Closed

non-shared web-worker return references window #61

laforge49 opened this issue Feb 5, 2016 · 6 comments

Comments

@laforge49
Copy link

A non-shared web worker does not have a window. But when such a web worker returns, a reference to window is made when using boot-reload. Specifically, window.location.protocol is referenced.

Uncaught ReferenceError: window is not defined(anonymous function) @ worker.js:2556
goog.events.EventTarget.fireListeners @ worker.js:2037
goog.events.EventTarget.dispatchEventInternal_ @ worker.js:2039
goog.events.EventTarget.dispatchEvent @ worker.js:2034goog.net.WebSocket.onOpen_ @ worker.js:2350
@martinklepsch
Copy link
Contributor

This needs a reproduction case or in just more information. How did you conclude that window.location.protocol is accessed?

@Deraen
Copy link
Contributor

Deraen commented Feb 5, 2016

Could be:

:protocol (.. js/window -location -protocol)})

Maybe this was not problem with shared workers as they didn't try to open WS connection or something?

@laforge49
Copy link
Author

Daraen,

Could also be for shared worker. My test for shared worker terminates the worker from the client.

Normally I would not run into this case, as workers normally wait for messages. I was just testing some new code and had disabled a bunch of code.

@laforge49
Copy link
Author

Martin Klepsch,

https://github.com/aatree/aademos/tree/reload-tworker-failure/tworker is a branch in aademos where a minimal tworker fails.

How did I know the failure was in window.location.protocol? Because I opened the chrom console, and clicked on the source. This is what was highlighted.

@laforge49
Copy link
Author

Daraen,

My error, this seems to have nothing to do with the exit of the webworker. Its just async as the code you referenced showed.

@Deraen
Copy link
Contributor

Deraen commented Dec 20, 2016

I think the latest changes should fix this: Boot-reload no longer tries to access window when started. This doesn't however mean that boot-reload would work with Web-workers.

#109

@Deraen Deraen closed this as completed Dec 20, 2016
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