tvcutsem/harmony-reflect

Uncaught ReferenceError: Proxy is not defined - with stable Chrome v36

xmlking opened this issue · 9 comments

Getting Uncaught ReferenceError: Proxy is not defined error with Chrome stable v36 or safari.
Works fine with Chrome beta v37 or latest stable Firefox.

how to reproduce:
access the following URL in Chrome v36 (stable) and see the console.
http://xmlking.github.io/spa-starter-kit/

Safari does not currently implement ES6 proxies or the older harmony proxies, and so this library will not work on it.

In Chrome v36 (stable, mac os x), opening your link does not reveal the ReferenceError, instead I get a GET http://localhost:8080/apiApp/stomp/info net::ERR_CONNECTION_REFUSED (probably because your code still references localhost). Entering Proxy in the console does reveal that the harmony-reflect shim was loaded successfully, and Proxy was patched successfully.

Perhaps you can share a more isolated test-case that illustrates the problem?

that means it is working for you on Chrome v36 (stable, mac os x).
I noticed this issue in Chrome Version 36.0.1985.125 on Windows 7.
on mac I have Chrome beta Version 37.0.2062.68 and latest firefox. both are working fine.
May be this is specific to windows's version of Chrome.
image001
image002

Have you enabled the "Javascript harmony" flag on Chrome? As described in this library's README, Chrome currently only provides Proxies behind a flag. To enable, copy/paste chrome://flags/#enable-javascript-harmony into your address bar.

my bad. I missed this point. now it is working as expected. hope we don't have to do this in Chrome 37+.
Thanks a lot @tvcutsem

no problem!

This is happening again with latest Chrome. I also tried chrome://flags/#enable-javascript-harmony
Chrome Version 38.0.2125.104
"harmony-reflect": "~1.1.0"
Any one else having this issue?

According to the V8 bug tracker, Proxy got removed from Chrome recently (see https://code.google.com/p/v8/issues/detail?id=1543#c44). I don't know the details why.

Proxies are still available in v8 or node using --harmony-proxies though, they're just not exposed to the browser.

Thanks @tvcutsem for update. It was working fine in 37 even without harmony flag.
Please keek this info under compatibity section in README.md sothat developers can save time debugging this issue.

Done!