tvcutsem / harmony-reflect

ES5 shim for ES6 Reflect and Proxy objects
http://www.ecma-international.org/ecma-262/6.0/#sec-reflection
Other
478 stars 48 forks source link

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

Closed xmlking closed 10 years ago

xmlking commented 10 years ago

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/

tvcutsem commented 10 years ago

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?

xmlking commented 10 years ago

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

tvcutsem commented 10 years ago

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.

xmlking commented 10 years ago

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

tvcutsem commented 10 years ago

no problem!

xmlking commented 10 years ago

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?

tvcutsem commented 10 years ago

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.

xmlking commented 10 years ago

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.

tvcutsem commented 10 years ago

Done!