Skip to content
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

Can't edit files #207

Closed
kirtapix opened this issue Nov 30, 2018 · 7 comments
Closed

Can't edit files #207

kirtapix opened this issue Nov 30, 2018 · 7 comments

Comments

@kirtapix
Copy link

kirtapix commented Nov 30, 2018

  • Version (cloudcmd -v): v11.8.2
  • Node Version node -v: v8.11.1
  • OS (uname -a on Linux): Linux NasPi 4.14.79+ #1159 Sun Nov 4 17:28:08 GMT 2018 armv6l GNU/
    Linux
  • Browser name/version: latest firefox
  • Used Command Line Parameters: /
  • Changed Config: /

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 :

  • modules/loadremote/lib/loadremote.js
  • join/join.js
    GET requests responses :
  • ENOENT: no such file or directory, lstat '/opt/nodejs/lib/node_modules/cloudcmd/modules/loadremote/lib/loadremote.js'
  • ENOENT: no such file or directory, lstat '/opt/nodejs/lib/node_modules/cloudcmd/join/join.js'

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
Copy link
Owner

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
Copy link

jcaron23 commented Dec 4, 2018

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:

  • /cloudcmd/modules/loadremote/lib/loadremote.js
  • /cloudcmd/join/join.js

The "right" URLs should be:

  • /cloudcmd/edward/modules/loadremote/lib/loadremote.js
  • /cloudcmd/edward/join/join.js

(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 #200 or the related changes in the editors?

@coderaiser coderaiser added the bug label Dec 4, 2018
coderaiser added a commit that referenced this issue Dec 4, 2018
@coderaiser
Copy link
Owner

coderaiser commented Dec 4, 2018

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

@coderaiser
Copy link
Owner

coderaiser commented Dec 4, 2018

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

@jcaron23
Copy link

jcaron23 commented Dec 4, 2018

@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
Copy link
Owner

@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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants