8000 tacodb 1.0.11 taco-demo fails with first argument must be string or buffer error. · Issue #4 · dominictarr/tacodb · GitHub
[go: up one dir, main page]

Skip to content

tacodb 1.0.11 taco-demo fails with first argument must be string or buffer error. #4

Open

Description

@No9

On linux ubuntu 13.10 and Mac OS 10.7.5

npm install tacodb -g

Checkout and install taco-demo

git clone git://github.com/No9/taco-demo.git
cd taco-demo 
npm install 
./build.sh

Browse to
http://localhost:8000/http/tacodemo/

Server crashes with

GET /http/taco-demo/ 1371464955325

http.js:955
      throw new TypeError('first argument must be a string or Buffer');
            ^
TypeError: first argument must be a string or Buffer
    at ServerResponse.OutgoingMessage.end (http.js:955:13)
    at respond (securify:1301:18)
    at /home/anton/github/lib/node_modules/tacodb/node_modules/level/node_modules/levelup/lib/levelup.js:189:13

Activity

  1. dominictarr commented on Jun 17, 2013

    @dominictarr
    Owner

    dominictarr: aha, I found the problem
    [1:11pm] dominictarr: it's to do with browserify bundles
    [1:11pm] dominictarr: the problem is in securify
    [1:12pm] dominictarr: the bfy stuff is bundling buffer-browserify
    [1:12pm] dominictarr: when we want it to just leave that out and use the core version.
    [1:14pm] no9: Ah so the error was in the right place so
    [1:16pm] dominictarr: yeah, the problem was it was doing res.end(buffer)
    [1:16pm] dominictarr: except node didn't agree that Buffer.isBuffer(buffer)
    [1:19pm] dominictarr: how i found the bug: read the node.js http code, then added a monkey patch to log what was really being passed to res.end(….)
    [1:24pm] dominictarr: if you want an urgent hack - fix level-static to always write strings
    [1:24pm] dominictarr: or
    [1:25pm] dominictarr: var end = http.OutgoingMessage.prototype.end; http.OutgoingMessage.prototype.end = function (data) { if (data) data = data.toString(); end.call(this, data) }

    will fix soon.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0