Flic Home

    Community

    • Login
    • Search
    • Popular
    • Users

    Buffer error

    Flic Hub SDK
    2
    2
    236
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • XattSPT
      XattSPT last edited by

      Anyone knows why Buffer function is not working?

      Simple code:
      // main.js
      var buf = Buffer.from('abc');
      console.log(buf);

      Returns on console:
      TypeError: undefined not callable (property 'from' of [object Function])
      at [anon] (duktape.c:65024) internal
      at [anon] (root/porva2/main.js:2)
      at require (init.js:131)
      at [anon] (init.js:139) preventsyield
      at runInit () native strict preventsyield
      at handlePacket (pipe_communication.js:48)
      at readCallback (pipe_communication.js:93) preventsyield

      1 Reply Last reply Reply Quote 0
      • Emil
        Emil FlicTeam last edited by

        Please add the following line at the top of your file:

        Buffer.from = function(v) {return new Buffer(v)};

        I think that should work.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post