coderaiser / cloudcmd

✨☁️📁✨ Cloud Commander file manager for the web with console and editor.
https://cloudcmd.io
MIT License
1.83k stars 257 forks source link

Can't edit files #207

Closed kirtapix closed 5 years ago

kirtapix commented 5 years ago

Hi,

Since I upgraded cloudcmd, I can't edit files. In firefox developer tool I can see that it can't load 2 scripts, when I hit "edit" button :

When I browse to "/opt/nodejs/lib/node_modules/cloudcmd/" there is no "module" and "join" directories.

Thanks in advance for your response !

Edit :

Reverted back cloudcmd to 10.8.2 and I can edit again

coderaiser commented 5 years ago

Hi @kirtapix,

I can't reproduce this, looks like a problem with service workers. Could you please go to URL about:debugging#workers and unregister all service workers?

Is it helped?

jcaron23 commented 5 years ago

I have the same issue using cloudcmd as express middleware with a prefix (not sure if it's the same issue OP is facing or not, and not sure if the issue is in cloudcmd or the editors).

Even the example given in the 11.7.0 release notes doesn't work. As soon as you try to edit a file, you get 404s for:

The "right" URLs should be:

(note the additional /edward).

I fixed those by adding redirects, and then you have additional issues with /edit.json, /modules.json, /options.json.

After that there are JS errors (TypeError: undefined is not an object (evaluating 'module.local') at loadremote.js:66), don't yet know where that comes from (removing the prefix in app.use everything works great, but I need the prefix).

The issue is probably related to https://github.com/coderaiser/cloudcmd/issues/200 or the related changes in the editors?

coderaiser commented 5 years ago

I understood, there is such a bug with a --prefix option. Fixed with 0fdbd90 🔨

coderaiser commented 5 years ago

Landed in v11.8.3 🎉 . It is works for you?

jcaron23 commented 5 years ago

@coderaiser Wow, that was quick! Definitely works much better now!

Just for completeness, I want to point out that there's an issue with the example in the 11.7.0 release notes, the socket doesn't work (as so configuration and console don't work either). My workaround is to use:

const socket = io.listen(server, { path: '/cloudcmd/socket.io'});

instead of:

const socket = io.listen(server);

But there may be another / a better way.

Thanks again for the very quick fix!

coderaiser commented 5 years ago

@jcaron23 yes, you absolutely right, this is because when you set prefix it will affect socketPath as well, the same implementation used in server/server.js, thank you!

kirtapix commented 5 years ago

Hi @coderaiser , Sorry for no response, was quite busy. It's working fine since your correction in 11.8.3. Thanks a lot ! and thanks to @jcaron23 too, for completing my problem with his expert explanation