espruino / EspruinoWebIDE

The Espruino Web IDE - A Chrome Web App for programming Espruino
Apache License 2.0
367 stars 158 forks source link

Can't set project directory #275

Open LukasEdl opened 1 year ago

LukasEdl commented 1 year ago

Hi everyone,

when i try to set the directory for the sandbox inside of the project tab, nothing happens and in the console i get an TypError. This works with the version 0.74.1 of the ide a breaks with version 0.74.2 and still breaks with the latest version (0.74.4).

Do you know how this can be fixed? Without it i cant use the different modules files of my project, since the IDE won't find the module files during the build.

gfwilliams commented 1 year ago

Where are you having the problem with the IDE? As a Chrome Web App?

Google is switching off the Web Apps very soon now, so it doesn't make sense to maintain them - but I will at some soon point be adding some support to the Online IDE - now the Web APIs have moved on enough that it should all be possible from espruino.com/ide

In the mean time, you can:

LukasEdl commented 1 year ago

The problem occures in the Web App as well as in the online IDE.

If i use the http workaround, would i then import the modules like that require('http://localhost/module1') ?

gfwilliams commented 1 year ago

The problem occures in the Web App as well as in the online IDE.

Yes, I'm not sure how that happened but the online IDE shouldn't really have had projects in it as that has never worked (the API isn't available on the web)

If i use the http workaround, would i then import the modules like that require('http://localhost/module1') ?

Yes, that should work - or potentially you may need to have a local https server

Pringels commented 1 year ago

This also happens to me on the web IDE. This is quite confusing at first given that the "project tour" button also does not work. I will take a look at porting the legacy chrome app functionality to the new Filesystem API.

gfwilliams commented 1 year ago

Thanks! For now I've just removed the option from settings.

It'd be great if you could look at that though - but if I recall the projects code was a bit hard for me to understand :)

Anonymous941 commented 7 months ago

How did you open developer tools? (I can't tell if it's a bug or setting, which is why I haven't opened a separate issue yet) Also, how can I get a file in the IDE to be a module? Without this option, I can't think of any workarounds

gfwilliams commented 7 months ago

Where are you running the IDE from? https://www.espruino.com/ide/ ? As above, that version (the recommended one) doesn't support the project plugin yet because all the APIs for file access have changed.

If you want to develop a module now, you have two options:

Did you see in the documentation somewhere that suggested using the Project plugin? If so let me know and I can update it to be clearer

Anonymous941 commented 7 months ago

@gfwilliams I'm trying to run it natively on Linux in order to use that feature, but can't use it or even open developer tools. I also tried to upload it to the emulator under that storage name, but regardless of it claiming it was in the emulator's storage, I can't import it.

gfwilliams commented 7 months ago

Ahh - ok, it's been a while since anyone tried to run a native version so I don't think you'll have much success. And the 'projects' feature was specific to Chrome Apps (https://chromewebstore.google.com/detail/espruino-web-ide/bleoifhkdalbjfbobjackfdifdneehpo) which Google discontinued.

The IDE may come up with an orange warning about the module not being there when uploading the code, but the code itself will find it and work

Anonymous941 commented 7 months ago

Thank you, that's working for me

ronaldroe commented 3 months ago

This is completely unusable as a local app. Not only can you not load any files via project, the dialog never even appears. Trying to connect to a board crashes it. I gave up and threw up my hands yet again at that point. Using Espruino without being tethered to the ridiculous WebIDE that is great for playing around and nothing else is a nightmare

gfwilliams commented 3 months ago

How are you running as a local app? The Projects option uses APIs intended for the Chrome Web Store, so it wouldn't work and shouldn't have been included.

If you don't want to use the Web IDE, maybe consider using the command-line tool: https://www.npmjs.com/package/espruino

If you can't get Bluetooth direct from it, try using what's explained under Web IDE Remote Connection in the above link.