ember-fryctoria
ember-fryctoria copied to clipboard
Bug on Safari with ember build -prod
Hi, I am using this ember-cli plugin, thanks for writing it and making it well organized.
There is some sort of critical bug when used with Safari or Mobile safari and the javascript code from ember build -prod.
I'm not sure where the error comes from, but the REST Adaptor will not do any Ajax calls, it dies before that. The code works as expected when ember build -dev.
ember-cli 0.2.3 ember 1.11.1 ember-data 1.0.0-beta.16.1 jQuery 1.11.3 Fryctoria alpha Mobile safari on iPhone OS 8.3 Safair on Macbook 7.1.5
- Uninstall the addon, remove the logics associated with it and see if your app works.(make sure the problem comes from the addon)
- If your app works without the addon, can you give me more error messages when you have the addon in production mode?
Here is the error message. I did a new app and it worked fine until the "ember install ember-fryctoria"
[Error] Error while processing route: friends undefined is not an object (evaluating 's.apply') http://23.21.247.171:4200/assets/vendor-eb54abec12ce4364710817c9da095718.js:20:17193 y@http://23.21.247.171:4200/assets/vendor-eb54abec12ce4364710817c9da095718.js:16:25411 b@http://23.21.247.171:4200/assets/vendor-eb54abec12ce4364710817c9da095718.js:16:25495 http://23.21.247.171:4200/assets/vendor-eb54abec12ce4364710817c9da095718.js:16:46192 http://23.21.247.171:4200/assets/vendor-eb54abec12ce4364710817c9da095718.js:11:16142 invoke@http://23.21.247.171:4200/assets/vendor-eb54abec12ce4364710817c9da095718.js:4:24632 flush@http://23.21.247.171:4200/assets/vendor-eb54abec12ce4364710817c9da095718.js:4:25152 flush@http://23.21.247.171:4200/assets/vendor-eb54abec12ce4364710817c9da095718.js:4:22531 end@http://23.21.247.171:4200/assets/vendor-eb54abec12ce4364710817c9da095718.js:4:11941 run@http://23.21.247.171:4200/assets/vendor-eb54abec12ce4364710817c9da095718.js:4:12320 join@http://23.21.247.171:4200/assets/vendor-eb54abec12ce4364710817c9da095718.js:4:12451 join@http://23.21.247.171:4200/assets/vendor-eb54abec12ce4364710817c9da095718.js:8:28341 _bubbleEvent@http://23.21.247.171:4200/assets/vendor-eb54abec12ce4364710817c9da095718.js:13:46251 http://23.21.247.171:4200/assets/vendor-eb54abec12ce4364710817c9da095718.js:13:45702 dispatch@http://23.21.247.171:4200/assets/vendor-eb54abec12ce4364710817c9da095718.js:2:19940 handle@http://23.21.247.171:4200/assets/vendor-eb54abec12ce4364710817c9da095718.js:2:16613 console.error ([native code], line 0) _ (vendor-eb54abec12ce4364710817c9da095718.js, line 10) error (vendor-eb54abec12ce4364710817c9da095718.js, line 10) E (vendor-eb54abec12ce4364710817c9da095718.js, line 10) u (vendor-eb54abec12ce4364710817c9da095718.js, line 16) trigger (vendor-eb54abec12ce4364710817c9da095718.js, line 16) (anonymous function) (vendor-eb54abec12ce4364710817c9da095718.js, line 16) y (vendor-eb54abec12ce4364710817c9da095718.js, line 16) b (vendor-eb54abec12ce4364710817c9da095718.js, line 16) v (vendor-eb54abec12ce4364710817c9da095718.js, line 16) d (vendor-eb54abec12ce4364710817c9da095718.js, line 16) (anonymous function) (vendor-eb54abec12ce4364710817c9da095718.js, line 11) invoke (vendor-eb54abec12ce4364710817c9da095718.js, line 4) flush (vendor-eb54abec12ce4364710817c9da095718.js, line 4) flush (vendor-eb54abec12ce4364710817c9da095718.js, line 4) end (vendor-eb54abec12ce4364710817c9da095718.js, line 4) run (vendor-eb54abec12ce4364710817c9da095718.js, line 4) join (vendor-eb54abec12ce4364710817c9da095718.js, line 4) join (vendor-eb54abec12ce4364710817c9da095718.js, line 8) _bubbleEvent (vendor-eb54abec12ce4364710817c9da095718.js, line 13) (anonymous function) (vendor-eb54abec12ce4364710817c9da095718.js, line 13) dispatch (vendor-eb54abec12ce4364710817c9da095718.js, line 2) handle (vendor-eb54abec12ce4364710817c9da095718.js, line 2)
I can not see any add-on related code in the stacks. Is that possible that you make a public repo so that I can take a look?
Can you access this site: http://23.21.247.171:4200/
It is "ember serve -prod" If you click on the /friends route, it will do a REST call. It works great in Chrome but generates that error in Safari.
-Josh
On Tue, May 12, 2015 at 8:55 PM, yang2007chun [email protected] wrote:
I can not see any add-on related code in the stacks. Is that possible that you make a public repo so that I can take a look?
— Reply to this email directly or view it on GitHub https://github.com/poetic/ember-fryctoria/issues/3#issuecomment-101471737 .
Ok, I've found the source of the error message, it is the line:
return _superFinder.apply(store, args);
in ember-fryctoria/addon/stores/main-store/decorate-api-call.js .
The funny thing is that if I add a debugging line just before, like:
Ember.Logger.debug('the _superfinder=', _superFinder);
then the problem goes away and the REST call works fine in Safari!
I don't know enough about Ember internals or what the store.__nextSuper is used for, so I'm not sure if there is any code that should be changed.
I will use my local modification (the debug print) when I need to deploy the production build.
Thank you very much for you feedback. Recently I did not get time on this addon. I will take a look into this as soon as possible.
FYI, the store.__nextSuper is the direct 'super' function in the chain of inheritance. In the code I was using their internal API which is subject to change and makes the addon brittle.
Again, thank you for your feedback. :+1: