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
Exception "Uncaught Error: Cannot read property 'reset' of undefined" #2562
Comments
Try deselecting all the minification options etc. in the app loader and then reinstall. |
Neither alarm nor sched.js do a g.reset(). Can you please post your installed apps with versions? |
I think the code that's causing the problem will be in E.showScroller by the look of it? But the issue is really that something has overwritten/deleted the global variable I just tried and I can't reproduce here by editing a pre-existing alarm - maybe you could post some more specific steps? Also see if it happens in the emulator or with a fresh install? It might also be worth logging in with the IDE and checking You could also try pasting this code into the REPL:
It should then throw an exception if something tries to overwrite |
This makes the difference. When installing with minification the error occurs, when installing without minification it works as expected.
No difference in the |
Ok, great - thanks! What happens if you toggle the minification option and then install just the alarm app? If we're sure that minification of just one app changes things then at least that will help to narrow down where the problem lies. |
This is what i did. If minification enabled it crashes if disabled it works. |
Thanks! We could attempt to fix the alarm app with some kind of hack, but I there will be others. I think the only real fix to to try and figure out how to tell esprima/escodegen not to use certain variables. I'm tempted to remove the minification option again? Or at the very least change the text The actual performance improvements are pretty minimal, and the downside of a bunch of otherwise good apps failing seems pretty huge. |
I've been running into the same problem - when an alarm triggers, I would see my watch freeze on loading, and when attached to an IDE, I saw the below backtrace (this exception halting the load). In each case, Oddly, when I check
|
Thanks. I'm honestly not sure what to suggest though - increasingly I'm thinking I should just remove the option (as I did previously). The minification just isn't reliable and doesn't give a good enough benefit for the times it works |
Yeah, I think I'd agree with you - we could look into tweaking the minifier for specific variables, but I expect that would break if we added more in future. I could sort a PR to remove the option? |
Thanks - yes, a PR for that would be good. Or maybe for now we could add an expandable area for 'Advanced Options' to the 'More...' tab, and reword the option to something like 'DANGER: minification will break some apps' |
This moves the minify option to an expandable advanced section, and changes the warning ("may" -> "will") See espruino#2562 for more details.
Sounds good - done (happy to tweak the look & feel) |
Going to close this as the problem's solved by #2709 |
Affected hardware version
Bangle 2
Your firmware version
2v16
The bug
I am not quiet sure where this error happens but it happens on my side when i try to edit an existing alarm via the alarms app:
i currently got no time to investigate this but maybe someone else can have a look :)
Installed apps
No response
The text was updated successfully, but these errors were encountered: