Git Product home page Git Product logo

Comments (8)

aglennquicket avatar aglennquicket commented on July 17, 2024 2

I'm not part of the project, but I fixed this myself from switching from node version 14 to 12.

from core.

john-perks avatar john-perks commented on July 17, 2024 2

I ran into this problem a couple of days ago, and think I've got to the bottom of it...

Short version: the use of .hasOwnProperty("readable") (and similarly for "writable") in vfs-socket/consumer.js and vfs-socket/worker.js are over-strict; as of Node 14, these properties are getters on the prototypes of Readable and Writable. This means that e.g. an IncomingMessage is no longer recognized by c9 as being readable, so that property is not set on the created token. Replacing those .hasOwnProperty() calls on the various stream and token variables in those files with a simple in operator check appears to fix this.

Longer version: If you compare the last v13 version of stream.Readable with the first v14 version, you'll see the readable flag is no longer set in the constructor, but defined as a getter/setter; the equivalent is done on Writable, which in turn necessitates some handling of it in Duplex. For whatever reason (The fake-multiple-inheritance trick of overriding this[Symbol.hasInstance]() not being available in Node at the time? A deliberate decision to prefer composition over inheritance?), both the the streams stored and created in vfs-socket are tested for their supported behaviour via values of flags rather than types. There are a bunch of places in c9 where a Stream is directly instantiated and readable/writable flags set on it, rather than creating a Readable etc.

Thing I'm not sure about: What was the motivation for insisting that these flags had to be own properties at the time, and does allowing inherited properties as well break it? It seems odd that the code in storeStream() will happily check the value of stream.readable and only later check if readable is an own property or not. Perhaps this was a valid concern for the Stream API in the version of Node it was originally written against, but may not apply anymore?

from core.

john-perks avatar john-perks commented on July 17, 2024 2

@drmrbrewer As I mentioned above, you need to update the mentioned vfs-socket files to replace stream.hasOwnProperty( "readable") with ("readable" in stream), and likewise for "writable". Maybe do the same for the various token variables too.

from core.

floeck1706 avatar floeck1706 commented on July 17, 2024

I have the same problem. I already auth the complete folder structure of .c9, c9sdk and the workspace but nothing works. I can't save files in the web editor. Does anyone has a solution for it?

from core.

jxmorris12 avatar jxmorris12 commented on July 17, 2024

@aglennquicket's answer fixed this issue for me! here's the concrete steps I took:

  1. quit c9
  2. use nvm to downgrade from node 14 to 12: nvm install 12
  3. restart c9

voíla!

from core.

drmrbrewer avatar drmrbrewer commented on July 17, 2024

@jxmorris12 @aglennquicket Any way of solving this without having to downgrade from node 14 to 12? Eventually this solution will no longer work.

from core.

keyboardDrummer avatar keyboardDrummer commented on July 17, 2024

Have you considered installing Node 12 in a custom directory and starting Cloud9 using that, while upgrading the global Node installation to whichever version you prefer?

from core.

drmrbrewer avatar drmrbrewer commented on July 17, 2024

@john-perks do you know what the solution is?

from core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.