ionic3 - Ionic 3: Error setTimeout -
we using:
- ionic framework: 3.6.0
- ionic native: ^2.2.6
- ionic app scripts: 2.1.4
- angular core: 4.3.5
- angular compiler cli: 4.3.5
- node: 6.11.2
(we went node_modules/@ionic/app-scripts , updated ws 1.1.4 (as -_-))
when doing ionic serve error:
runtime error
macrotask 'settimeout': can not transition 'running', expecting state 'scheduled', 'notscheduled'.
we tried upgrading using outdated pretty advice found on subject boils down to. error still there sometimes. when reload 1 out of 3 times there error.
the oh professional "fix" follows:
<script> window.uneffedtimeout = window.settimeout; </script> <!-- polyfills js generated during build process --> <script src="build/polyfills.js"></script> <script> window.settimeout = window.uneffedtimeout; </script> so question:
is there way achieve applicable people outside of mental institutions?
edit
since initial salt fueled explanation wasn't accurate should have been let me clarify:
the error not happend because call settimeout in my code. angular and/or ionics additions angular call under hood when page loads. cannot change fact call happens nor can reasonably change how call made.
what seems happen polyfill generated patches browser provided settimeout method own implementation. implementation either faulty or not work other part of code.
this evidenced fact if revert settimeout how before polyfill messed it, works fine.
now want polyfill either give functional implementation of settimeout or not mess @ all. "fix" accomplishes later in crappy way. rather have solution doesn't require me repair broken components during runtime.
settimeout(() => { somefunction(); }, 500);
Comments
Post a Comment