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

Inspector does not recognize app if Ember.ENV.EXTEND_PROTOTYPES does not exist #1114

Closed
jdrobertso opened this issue Dec 20, 2019 · 10 comments · Fixed by #1117
Closed

Inspector does not recognize app if Ember.ENV.EXTEND_PROTOTYPES does not exist #1114

jdrobertso opened this issue Dec 20, 2019 · 10 comments · Fixed by #1117
Labels

Comments

@jdrobertso
Copy link

Issue and Steps to Reproduce

On opening Ember inspector on one of my Ember apps, I am getting the below stack trace.

raven.js:383 Uncaught TypeError: Cannot read property 'Array' of undefined
at n.callback (:402:35)
at n.exports (vendor-ff8d5821b66c1…b3ac1b81a4b902.js:3)
at n._reify (vendor-ff8d5821b66c1…b3ac1b81a4b902.js:3)
at n.reify (vendor-ff8d5821b66c1…b3ac1b81a4b902.js:3)
at n.exports (vendor-ff8d5821b66c1…b3ac1b81a4b902.js:3)
at requireModule (vendor-ff8d5821b66c1…b3ac1b81a4b902.js:3)
at sendVersionMiss (:9612:19)
at :9420:7
at triggerOnce (:9493:7)
at completed (:5962:7)
at d (raven.js:379)

On debugging, I found that it hits the code mentioned in the PR here. Specifically: if (Ember.ENV.EXTEND_PROTOTYPES.Array) is the line throwing the error. In my app, Ember.ENV.EXTEND_PROTOTYPES is undefined.

Your environment

This issue is definitely present on the latest version of the Chrome Browser tool. On Firefox, the stack trace instead says TypeError: Ember.ENV.EXTEND_PROTOTYPES is undefined, but is essentially caused by the same issue. The Ember CLI version for the app is 2.5.0.

@RobbieTheWagner
Copy link
Member

@chancancode thoughts?

@chancancode
Copy link
Member

Eh! Good catch, will fix soon!

@chancancode
Copy link
Member

chancancode commented Dec 20, 2019

It's caused by this line:

if (Ember.ENV.EXTEND_PROTOTYPES.Array) {

It should be if (Ember.ENV.EXTEND_PROTOTYPES && Ember.ENV.EXTEND_PROTOTYPES.Array). If someone wants to send a pull request please go ahead, otherwise I'll do it in a few hours. Hoping to cut another patch release today to fix this and a few other minor issues.

@chancancode
Copy link
Member

Working on it now!

@chancancode
Copy link
Member

@jdrobertso what is the ember-source version of your app?

@jdrobertso
Copy link
Author

@chancancode It looks like we are not using ember-source in that version of the app.

@chancancode
Copy link
Member

I'm not exactly sure how this can happen, now that I think about it. Ember normalizes the Ember.ENV.EXTEND_PROTOTYPES into an object, and as far as I can tell, that code has been around for a long time, and it's definitely there on 3.4: https://github.com/emberjs/ember.js/blob/lts-3-4/packages/ember-environment/lib/env.ts#L166-L178

The way it's supposed to work (I could be wrong, cc @rwwagner90), is if your ember version is below that, it should switch to the old adapters, in which case this code shouldn't even run. But maybe the code is still loaded?

@chancancode
Copy link
Member

@jdrobertso what is Ember.VERSION?

@jdrobertso
Copy link
Author

@chancancode Apologies, I was going off the package.json ember-cli version. Ember.VERSION is 1.13.13.

chancancode added a commit that referenced this issue Dec 20, 2019
chancancode added a commit that referenced this issue Dec 20, 2019
chancancode added a commit that referenced this issue Dec 20, 2019
chancancode added a commit that referenced this issue Dec 20, 2019
chancancode added a commit that referenced this issue Dec 20, 2019
Fixes #1114

(cherry picked from commit cedf8f0)
@chancancode
Copy link
Member

Fixed and published!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants