-
Notifications
You must be signed in to change notification settings - Fork 72
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
console.log(String(new Set)) => [object Object] // was: Multiple issues with bigger project #29
Comments
SOLVED - but that just means there's another problem: Turns out the session had expired. However, I only found out after.. "doing stuff", an overlay popped up telling me to reload the page.
|
Another problem: The upload is very slooooooooooooooooow. The network activity gadget of the IDE (probably correctly) shows 100-200 Bytes/sec average (no typo). I'm connected through Ethernet (wire), WiFi is off on the device. Earlier I had trouble loading the IDE from the (freshly started) device, after USB out/USB in (to restart) it worked, but now that slow upload. Im Screenshot ging es gerade für einen Moment schneller, aber wirklich nur in dem Moment. Die gerade mal 579 kByte laufen schon ein paar Minuten. |
Now the upload stopped, I got an error message, and then I could not reach the device any more, not even the homepage ("Device unreachable" network level message from Chrome). Now it's back up again, it was unreachable (completely) for over a minute. EDIT: Another directory upload, same issue after some ten minutes or so. |
New attempt using
EDIT: 2nd attempt after power on/off of the device - same result. |
Well, I must say, you are most one of the early users of our software. |
No worries, it is what it is. ¯\_(ツ)_/¯ |
I think the problem is solved. Can you give me the mac address of your device (the 12-digit code), I will then enable the update for you to try out. |
If my router is right it's 30:AE:A4:60:30:CF (ethernet interface) |
Whoops, we did optimize things, but after retesting we found an even bigger error which rendered the Ethernet port unusable. As we now have a workaround, we will get the software updates ready by tomorrow 2 PM MEZ |
Have to postpone to 10 PM today. Everything is working, but with the new version SPI and UART have some changes, and need to update the documentation before enabling the update. Can only do this tonight. |
OK, it took longer than I thought. Please try out the update which you should be able to install in the IDE. |
If I remember that right from the previous update I should get a button in the upper right corner of the IDE? Right now I don't see anything. |
Your device (with the MAC above) connected to our update server exactly 2 min before your post. Maybe it took to long? Everything looks correct, can you retry? |
I just retried and saw nothing. |
OK, we need to test this more in the future. |
More than half an hour has passed and the red light keeps blinking. i would like to turn it off because lunch is waiting... last time it was all updated after a minute or two. PS: Going to the URL shows the "neonious one is updating!" page, so the device still is reachable and online. |
Well, turn it on after lunch again, please, maybe it's working now. If not, we will figure it out.. Background Info: Conclusion: |
I turned it back on and it just keeps blinking (red), homepage still loads and says "neonious one is updating". It's been almost an hour. |
Seeing the requests. Keep it on please, looking into it. |
Is a different problem now (first problem was disconnect right after connect, now it stalls). Are you using the Ethernet port? In this case, this could be the same problem you had with the IDE upload. Now added a rate limiter, we will see if it works soon. Upload now takes 20 Min, but if it works then, it was worth it. |
I'm still using the Ethernet port as I always have. So I just wait? Okay, no problem. |
Yeah well, as we are fixing the Ethernet port now we should have maybe thought about switching to Wifi before updating :-) What a drama. Just for testing purpose: If it is still updating, can you quickly reboot it? Just added some logging features and it would be great if it reconnected. |
Done. |
OK. This is no use. It just stalls. You can turn it off. Let me do several tests this evening. Scenarios: (1) The problem is the Ethernet port (which most probably is the case because I could update at least with the changes I made - it was two different bugs in ESP-IDF). In this case I hopefully can find a configuration which works. (2) If this problem is the Ethernet port, but this is unsolvable, there are two options: I think Set Settings with lowrmt works in Updater mode. You could enable Wifi and disable Ethernet. I can tell you whether your settings change worked by looking in the log. (You could try this now, too, but only if you have spare time, please). I think you have a second board? You could update it via Wifi and we would send a replacement board. But for this, let me check first. (3) In the worst case scenario the problem still has nothing to do with Ethernet, lets talk about that after the tests. (Good that only a handfew of boards were updated to 1.2.0 by other people yet) Thomas |
The red light stopped and the IDE loads, is this the new or the old version now? Installing an update is not offered now. |
Does it say version 2018-11-13 on the login page? If yes, congrats! The rate limiter did work after all and it was the Ethernet port.. I guess this was a warning for us to start doing unit tests :-)
|
|
We know of some problems with lowrmt, might work far better when the update we are testing is deployed. But good if things are working for now. Closing this issue, but of course ready for new ones :-) |
can you try http?
Von meinem iPhone gesendet
… Am 21.11.2018 um 16:33 schrieb KittenWithHerbs ***@***.***>:
UPDATE
I'm using the IDE "upload directory" feature right now, device software version 19 November. The speed issue still exists, uploading 250 kByte takes ages, upload speed is in the single digit kByte/s.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Right now I cannot try anything at all, because all I get is a stack overflow after adding some code (just loading some of our modules, I'm not even doing anything with them yet). So all I get is a broken IDE, expired session message, and I have to try to somehow quickly disable those lines of code before I get logged out again. Honestly,. I think the IDE is a nice touch but nothing but a toy in the end (sorry for being quite frank). I think development should be off-device, on the PC, with remote debugging from an actual IDE. Orthogonal issue: If there is an issue the device should not attempt to run the code again or I end up with an endless restart loop. I guess that's the IDE doing it though. |
How do you know it's a stack overflow? Does it say so?
Let me think about this. Hopefully I know how to proceed sometime tonight.
Thomas
neonious GmbH
Münsterstr. 246 / 40470 Düsseldorf / Germany
T +49 211 9241 8187
F +49 211 9241 8172
www.neonious.com <http://www.neonious.com>
Managing Director & CEO: Thomas Rogg
Commercial Register: Amtsgericht Düsseldorf, HRB 83086
Am 21.11.18 um 17:31 schrieb KittenWithHerbs:
…
Right now I cannot try anything at all, because all I get is a stack
overflow after adding some code (just loading some of our modules, I'm
not even doing anything with them yet). So all I get is a broken IDE,
expired session message, and I have to try to somehow quickly disable
those lines of code before I get logged out again.
Honestly,. I think the IDE is a nice touch but nothing but a toy in
the end (sorry for being quite frank). I think development should be
off-device, on the PC, with remote debugging from an actual IDE.
Orthogonal issue: If there is an issue the device should not attempt
to run the code again or I end up with an endless restart loop. I
guess that's the IDE doing it though.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#29 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AlvYFO8KKpEseZonCWFypqjDCs0iyahGks5uxX_1gaJpZM4YVFwn>.
|
While the IDE still is up for a few seconds I can see it, and the final popup message on the automatically loaded login page says An fatal error has occured in the program: Error: stack full (ask neonious when this is more flexible) Program cannot continue. |
First, sorry for the problems. Yes, we really are at an early stage. What the problem is: (1) Every require adds around 20K to the CPU thread stack (not the JavaScript stack), and when they are nestled, the CPU thread stack is at it limit quickly. This is different from calling JavaScript recursivly. When that is done, the JavaScript stack builds up, but it does not use additional bytes from the underlying CPU thread stack, so here there is no limit other than the 4 MB heap. (2) There is an exception when the CPU thread stack is at it limit. But it seems like it is called too late. So yes, the program halts. But also after that, the OS crashes, because we have a real stack overflow. (3) Because of the reboot of the MC the session of the IDE gets invalid. (4) Also, on the other side: Writing data to the flash is not fast. With lowrmt it takes even longer, because currently it builds a new HTTPs stream for every file, and the handshake takes a second. The fastest right now will be HTTP over the IDE. So, please try that out. What the solution is: (1) There is an update available now which allows require() chains limited only by the heap. This is done through a unorthodox operation of copying the stack to the heap when the stack grows too much. Looking through the code I think all cases are handled. It seems to work, please try it out. (2) There will be an update of lowrmt next week, which actually makes the sync usable well. Then, I think, you will no longer need the IDE. (3) Also, we have on the list to make low.js save a crash report in a file when the OS crashes + skip auto-start if a crash happens within 5 min of boot. Sorry if you will have to resync once. Thomas |
Using the IDE right now (would there be a difference in how this is handled if I used the CLI tool?). I'm having trouble with
I uploaded a folder lib/ with ES6 code files to the top level. Within the src/ folder there is a file that loads modules from there using (for example) Next, in one of those included files I create a method module.exports.test = () => {
return new Set([1, 22, 3]);
};
// Prevent further parsing of the rest of the file
return; From a /test URL path request function in index.js I then create string output
I also tried it directly in index.js. It seems to me that there is transpilation, otherwise I would have seen a syntax error, but it does not actually work? Using So... how does the automatic transpilation actually work? Should I transpile myself? Then I have to put pretty big repos on the device a) for Babel runtime support functions, b) for polyfills. How do you solve this? |
Good, the stack compression works. (Note that I've noticed a crash every
dozend tries... But this will be gone in a few days, tooo).
Transpilation is done by TypeScript if using Webbrowser. We are using
TypeScript, because some day we can then just enable that people can use
TypeScript syntax and not only ES6 in the webbrowser.
lowrmt is using babel. Not sure if this was a good decision, we might
change to TypeScript with lowrmt, too, so we have the same behaviour
We should allow the user to look into the transpiled files, but
unfortunaly that is not developed yet.
Can you isolate the problems into simple examples with a few modules and
few lines of code? If so, we will fix them as fast as we fixed the other
things.
|
Note: Object.values() is not even ES6, it's even newer:
https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Object/values
I would suggest not to use it.
|
Note:
The difference in reporting (see below) is now on my list. For
everything else, please give me more info.
Thomass-MacBook-Pro:~ thomas$ low
String(new Set())
'[object Object]'
(To exit, press ^C again or type .exit)
Thomass-MacBook-Pro:~ thomas$ node
String(new Set())
'[object Set]'
|
1
As I wrote, the output of That is actually a TypeScript issue. I think the TS compiler option
Or it's actually a bug, because the code it produces for spreading a Set into an array is wrong. This is the error I see. Note that spreading a set into an array is perfectly fine ES 2015(+).
|
All problems are solved in the current update you can now install, with exception of console.log(String(new Set)) returning [object Object]. This issue we must discuss with the Duktape team. Keeping this issue open, till this is done (however low priority). Thank you for the info that Babel supports TypeScript, too. So we can either make both lowrmt and IDE Babel-based, or both TypeScript compiler-based. But this is not highest priority right now either. Regarding your question: BTW: A new version of lowrmt fixing many problems and making it usuable is scheduled for this week... |
Please, Babel, that's the point... with Babel you get TS too, with TS you get only TS. Not everybody writes Typescript, and knowing both Flow and TS pretty well after years of using and reading issues on Github and reporting them and answering many I have to say there is way too much hype from people who barely know both. Both TS and Flow have lots and lots of issues. Flow has the advantage of not changing the actual Javascript (just remove the types and it's Es 2015+), with TS that's not always true. Also, as I describe above, in the 1st point, TS here has a bug — definitely a bug, since it produces non-functioning code (if it can't do something it could/should produce an error, not silently produce code that attempts to use a function that does not exist). Babel works. Note: The issue with
This is perfectly valid ES 2015 code that produces an array
|
No, my question was about the runtime code. Polyfills and "support code" used to polyfill ES 2015+ features after down-compilation. Those libs take up space. |
Those polyfills are in init.js which runs before the program runs. Yes, it needs some space, but as you can see we only use select polyfills right now. It fits quite well. You are right.. [...(new Set([1,22,3]))] produces non-working code if downlevelIteration is false. It is true in the newest update, so this is not a problem. This produces working code if Symbol.iterator for Set exists (which it does now). But the Babel version with Array.from is nicer, true. I understand Babel is the better choice. We will look at that, but it's lower prio. |
The firmware has a date of 26 November, but I don't think that's the one you meant since it still says
which is the TypeScript bug mentioned above and you said that should not happen with the mentioned TS compiler flag set. Also, latest changelog entry is 22 November. PS: By the way, there is a typo in "An fatal..." |
Try triggering a retranspilation bei adding a new line to the file. The update is correct we will update changelog tonight.
Thomas'
|
What I did was, from the IDE,
Modal popup in the IDE:
Error:
I then removed the type-checks.js module and tried again, works. So I added a few more types, same as object-recipes.js already does ("types" means JS objects of the kind Now this error:
In the IDE highlighted is the third line (with the // "module.exports" is line #500
module.exports.VERSIONED_OBJECTS = RECIPES.reduce(
(arr/*: Array<string>*/, recipe/*: RecipeObj*/)/*: Array<string>*/ => {
if (recipe.rule.some((rule/*: RecipeRule*/)/*: boolean*/ => rule.isId === true)) {
arr.push(recipe.name);
}
return arr;
},
[]
); Not sure if those line numbers are correct? I may have to try the |
So I just tried *
I think the line numbers are of the transformed file, which I cannot see. Whatever this is, it should have been transformed. |
The stack problem: I was not aware that there are more functions than require which are implemented in C which build up the low-level C/C++ program stack. This is actually quite easy to fix: The stack moving implemented in require must be moved to a more central location, right around the interpreter. This we hopefully have implemented tomorrow. The second problem I understand, too. What I mean with this, that the following still outputs undefined: I asked Sami from DukTape about this, I hope he answers quick. Thomas |
Both fixed. Testing, because a few other things were added with the new version. Will write when update is available. Thank you for your patience (hopefully).. |
Update is now available. Check change log for other things in update. |
I don't know how to debug the latest issue, because the exact same code behaves differently in different contexts. Trivial helper
The simplified test code line:
Case 1To the demo
When I call /test1 I get TRUE. Case 2I have a lengthy function
This code is not run in response to a URL request but during webserver startup. I simply Here, Console output:
The output for "referenceTo" properties, which are ES2015 Set objects, does not show what's inside them, but it's just |
I mixed using |
When I do everything with
|
Closing this issue and using small individual issues instead. |
I started the IDE provided by the NEONIOUS ONE and tried to "upload directory", using my local lib/ directory with transpiled files. Nothing happened except his:
There is no error message available.
The IDE offered a firmware update a few days ago, I installed it, so I should be running whatever the current software version for the device is.
The text was updated successfully, but these errors were encountered: