stackvana / hook.io

Open-Source Microservice Hosting Platform
https://hook.io
Other
1.26k stars 117 forks source link

Buffer is not defined #186

Closed reimertz closed 8 years ago

reimertz commented 8 years ago

I just started to see


/node_modules/redis/index.js:602
                throw err;
                      ^
ReferenceError: Buffer is not defined
    at evalmachine.<anonymous>:21:22
    at /node_modules/hook.io-datastore/index.js:156:12
    at try_callback (/node_modules/redis/index.js:592:9)
    at RedisClient.return_reply (/node_modules/redis/index.js:685:13)
    at ReplyParser.<anonymous> (/node_modules/redis/index.js:321:14)
    at ReplyParser.emit (events.js:107:17)
    at ReplyParser.send_reply (/node_modules/redis/lib/parser/javascript.js:300:10)
    at ReplyParser.execute (/node_modules/redis/lib/parser/javascript.js:203:22)
    at RedisClient.on_data (/node_modules/redis/index.js:547:27)
    at Socket.<anonymous> (/node_modules/redis/index.js:102:14)
Marak commented 8 years ago

How are you triggering this error?

If I run the database basic examples, it doesn't come up?

https://hook.io/marak/examples-datastore

https://hook.io/marak/examples-datastore/source

Marak commented 8 years ago

I also just freed up about 68 gigs of HD space on production. We may have been low on disk.

reimertz commented 8 years ago

@marak, it seems to work now. Yeay!

reimertz commented 8 years ago

@marak Actually, it's weird. It works when creating a new hook. But once it's saved and called, you get these errors. I have been trying 4-5 times now.

You can see it here the bug in production here -> https://hook.io/reimertz/13374real/source

Marak commented 8 years ago

@reimertz -

Okay, now I understand.

If you look, Buffer global object is not being passed into Node.js VM.

https://github.com/bigcompany/hook.io/blob/master/bin/run-hook#L289

I have hot-patched the server to now include Buffer. Can you try running your example again?

reimertz commented 8 years ago

it works <3

Marak commented 8 years ago

Great. Thanks for the feedback.

I'll commit the fix soon and close this issue when it's pushed.

Marak commented 8 years ago

Was resolved with https://github.com/bigcompany/hook.io/commit/04046e01fbdd1be6950a5cee62af068ce9aa90b1

Closing.