Fails to load in Chrome 35, "Cannot read property 'injectedScript' of undefined"
Chrome 35.0.1916.153, running as pristine test user. Background page console says:
Error in event handler for (unknown): Cannot read property 'injectedScript' of undefined
Stack trace: TypeError: Cannot read property 'injectedScript' of undefined
at chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/device/RegisterExtension.js:47:57
at disconnectListener (extensions::messaging:335:9)
at Function.target.(anonymous function) (extensions::SafeBuiltins:19:14)
at EventImpl.dispatchToListener (extensions::event_bindings:395:22)
at Function.target.(anonymous function) (extensions::SafeBuiltins:19:14)
at Event.publicClass.(anonymous function) [as dispatchToListener] (extensions::utils:65:26)
at EventImpl.dispatch_ (extensions::event_bindings:378:35)
at EventImpl.dispatch (extensions::event_bindings:401:17)
at Function.target.(anonymous function) (extensions::SafeBuiltins:19:14)
at Event.publicClass.(anonymous function) [as dispatch] (extensions::utils:65:26) extensions::event_bindings:383
EventImpl.dispatch_ extensions::event_bindings:383
EventImpl.dispatch extensions::event_bindings:401
publicClass.(anonymous function) extensions::utils:65
dispatchOnDisconnect extensions::messaging:290
As far as I can see, it's supposed to perform an xhr request, but it doesn't do this.
Same problem. Chrome 35.0.1916.153
I just tested with a new users and the same version but didn't have that issue. Perhaps OS related?
OS X here.
Same issue for me. I just reinstalled the extension and the same problem occurs.
OSX Mavericks Chrome Version 35.0.1916.153
:+1: same problem same versions as @tsimons
same problem same version as up
same problem same version as up
Same issue on Chrome Version 36.0.1985.125 on OS X 10.9.4
Same here. Any news guys? Comments say to expose React as global but that doesn't help.
@enricribas your problem sounds different than this issue, which is that the extension doesn't load at all.
I have what might be a fix. I can't reproduce though so I have no idea what this will or will not fix. The diff is in #43. I packed the extension and have a crx file if anybody is willing to give it a try: http://cl.ly/WqYL
@enricribas, I may have jumped to conclusions about your case. Sorry!
@zpao I just loaded that extension. The error goes away, but the tools don't load. I get the:
Download the React DevTools for a better development experience: http://fb.me/react-devtools
message in my console from React, and the background page of the extension has no errors.
(chrome v. 36.0.1985.125, OS X 10.9.4)
@zpao: I've got the same result as @tsimons. The error goes away, the React devtools don't load, and the DEVTOOLS_INJECTED_SCRIPT key in localStorage is set to function(){console.error("undefined")}.
Edit: But it might just be my app; the test page loads the React tools perfectly.
If the test page and the React website work, then I'm going to blame your app. Make sure you export React to the window, as mentioned in the readme. If you can inspect anything, I think this fix is fine. Let me know!
Exposing react to window worked for me. Thanks for pointing that out.
Would it be possible to modify the script that logs the "download devtools" message to also check for window.React?
Yeah, it now works for me, too.
The only thing is, I was already explicitly exposing window.React, but I'll just chalk it up to one of those oddities in computers.
Thanks, guys.
Works for me, too, even without the fix from @zpao.
Thanks for testing! I'll get the fix merged in and make sure we push out an update.
Would it be possible to modify the script that logs the "download devtools" message to also check for window.React?
We're (slowly) working on better solution there. Simply checking for window.React isn't enough and actually wouldn't work at the point we log that message.
Yeah I realized that after I had submit... haha.
I also noticed one thing that related to some confusion here, and this is probably due to my lack of chrome extension knowledge. The script that loads the extension in the chrome inspector panel only runs when you first visit a site. For instance, I added window.React = React to my app, then refreshed my currently open page and nothing happened. When I opened a new tab and visited my app again, the react tab appeared. Hopefully this clears up some confusion for someone else!