ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

bug: Error: ATTempted to assign to readonly property on ion-slide

Open gimox opened this issue 11 years ago • 15 comments

Type: bug

Platform: ios 8 webview

i have this error. it fire on ios simulator and real device.

Error: Attempted to assign to readonly property.
ChildScope@http://10.5.44.212:8100/lib/ionic/js/ionic.bundle.js:22509:23
$new@http://10.5.44.212:8100/lib/ionic/js/ionic.bundle.js:22517:40
boundTranscludeFn@http://10.5.44.212:8100/lib/ionic/js/ionic.bundle.js:15919:40
controllersBoundTransclude@http://10.5.44.212:8100/lib/ionic/js/ionic.bundle.js:16583:35
ngRepeatAction@http://10.5.44.212:8100/lib/ionic/js/ionic.bundle.js:33329:26
$watchCollectionAction@http://10.5.44.212:8100/lib/ionic/js/ionic.bundle.js:22937:21
$digest@http://10.5.44.212:8100/lib/ionic/js/ionic.bundle.js:23070:31
$apply@http://10.5.44.212:8100/lib/ionic/js/ionic.bundle.js:23333:31
http://10.5.44.212:8100/lib/ionic/js/ionic.bundle.js:25059:42
completeOutstandingRequest@http://10.5.44.212:8100/lib/ionic/js/ionic.bundle.js:13732:15
http://10.5.44.212:8100/lib/ionic/js/ionic.bundle.js:14112:33

my ionic version is 1.0.1

this error appear when i have a ion-slide with more than one image and i switch between views (with cache: false). It appear randomly. it's not a blocking error but somethink crash view app. not solution jet need help!

gimox avatar Jul 16 '15 10:07 gimox

Same thing here. It's ionic-slide with ng-repeats inside of it that seems to causes this. I also have view caching turned off.

uxder avatar Aug 03 '15 19:08 uxder

ok i found the solution. It's a safari mobile bug related to angularJs. To solve it we need to rewrite all code like this:

object.$$a = 5;

to this:

var __webkitAssign__$$a = '$$a';
object[__webkitAssign__$$a] = 5;

The npm repo has a fantastic utility that help us.

https://www.npmjs.com/package/webkit-assign It rewrite the ionic bundle for safari bug and IT WORK PERFECT!.

gimox avatar Aug 04 '15 07:08 gimox

Thanks that worked.

uxder avatar Aug 04 '15 20:08 uxder

yeaaaa!

gimox avatar Aug 05 '15 07:08 gimox

Is this still an issue with angular 1.4?

mhartington avatar Aug 17 '15 16:08 mhartington

@mhartington I just encountered this issue and I updated to Ionic 1.1.0 with Angular 1.4 to see if it would fix the problem but it still persists on iOS8.4 iPhone 6 sim.

mrtomrichy avatar Aug 25 '15 12:08 mrtomrichy

So this is an issue still? Could you provide a codepen to test against?

mhartington avatar Aug 25 '15 15:08 mhartington

problem is here in ionic 1.1 and angular 1.4.*, patched as above in my post and it worked.

gimox avatar Aug 31 '15 10:08 gimox

I am able to webkit-assign ionic bundle and it works just fine, but I am not able to get it to work with the minified version of ionic bundle. I get angular not defined.. @mrtomrichy , @gimox , any ideas?

manuelnaturalcycles avatar Dec 04 '15 10:12 manuelnaturalcycles

follow this guide:

  • http://blog.ionic.io/minifying-your-source-code/
  • https://www.airpair.com/ionic-framework/posts/production-ready-apps-with-ionic-framework

you need some trick to minify angular.

gimox avatar Dec 04 '15 10:12 gimox

ty @gimox

manuelnaturalcycles avatar Dec 04 '15 11:12 manuelnaturalcycles

thanks a lot @gimox. Your solution solved my problem as well. I am using ionic 1.1.1 and 1.0.0-rc.05 and angular 1.2.28

wang3g avatar Dec 12 '15 11:12 wang3g

Hello! Is this still an issue with the latest version of ionic?

jgw96 avatar Mar 15 '16 17:03 jgw96

Hello! Thanks for opening an issue with us! Since it has been a little while since there was any activity on this issue i will be closing it, but feel free to respond back if your still having the issue! Thanks again!

jgw96 avatar Mar 21 '16 20:03 jgw96

+1 still getting this on iOS v8 with Ionic 1.4.9

ghost avatar Mar 23 '16 18:03 ghost