Esprima minification results in out of memory error on upload #1264
Replies: 7 comments
-
Posted at 2018-12-17 by Wilberforce In the IDE - you could try the save on send setting of Direct to Flash (execute at boot) |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-12-17 by opichals IMO it would be worth to replace Esprima minification with the recently merged Terser minifier (see espruino/EspruinoTools#80). @gfwilliams Another reason to deprecate Esprima (it has all kinds of issues with ES6 code). |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-12-17 by Wilberforce @opichals |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-12-18 by @gfwilliams @wilberforce it is merged, it's just not live yet - you should be able to load it manually from GitHub if you want to try it. Before putting it live I want to test the module loading on the main IDE platforms first. In this case it sounds like Terser is unlikely to help (if the issue really is that everything gets shoved on one line). I'd suggest turning on |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-12-29 by DrAzzy Where is the "Direct to Flash" option? Do you mean "save on send"? Is this a problem related to custom board? If so, how do I fix it? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-12-29 by DrAzzy Uncaught Error: Unable to find or create file |
Beta Was this translation helpful? Give feedback.
-
Posted at 2019-01-02 by DrAzzy Okay, that was a problem with my build, which I've fixed. Wow. Save on send is incredible, so much ram savings! |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-12-17 by DrAzzy
I'm trying to upload a block of code to an Espruino (it's my Espruino Board clone, but it's just a clone of the official Espruino with the D-spec part, so this should happen with normal Espruino board as well). Using the IDE, connected via USB - nothing special.
If I upload my code with No Minification, it uploads fine.
If I use the Closure Compiler, it uploads fine.
If I upload my code with Esprima minification, I get a memory error immediately on uploading it, and not all the code gets saved.
Is there any fix or workaround for this? Something that needs to be fixed in the IDE?
My guess is that it's rolling multiple commands (maybe all of them?) into one line, resulting in the Espruino getting this huge blob of code that it can't handle in one "bite"?
Espruino Web IDE version showing as 0.70.6.
Beta Was this translation helpful? Give feedback.
All reactions