insomnia-mockbin icon indicating copy to clipboard operation
insomnia-mockbin copied to clipboard

Cannot create bin with docker (Promise is not defined)

Open brianlow opened this issue 8 years ago • 6 comments

Start mockbin:

docker run -d -p 6379:6379 --name mockbin_redis redis
docker run -d -p 8080:8080 --link mockbin_redis:redis mashape/mockbin

Browse to http://localhost:8080 in incognito mode, click Create Bin menu item, click Create Bin button:

ReferenceError: Promise is not defined
   at validator (/usr/src/app/node_modules/har-validator/lib/promise.js:42:14)
   at Object.response (/usr/src/app/node_modules/har-validator/lib/promise.js:110:10)
   at Object.module.exports (/usr/src/app/lib/routes/bins/create.js:46:12)
   at Layer.handle [as handle_request] (/usr/src/app/node_modules/express/lib/router/layer.js:95:5)
   at next (/usr/src/app/node_modules/express/lib/router/route.js:131:13)
   at IncomingMessage.<anonymous> (/usr/src/app/lib/middleware/body-parser.js:52:9)
   at IncomingMessage.emit (events.js:92:17)
   at _stream_readable.js:944:16
   at process._tickCallback (node.js:458:13)

brianlow avatar Dec 16 '16 17:12 brianlow

Also experiencing this.

bobbytables avatar Jan 26 '17 21:01 bobbytables

same here

orasik avatar Sep 29 '17 14:09 orasik

Same error is still happening:

ReferenceError: Promise is not defined
   at validator (/usr/src/app/node_modules/har-validator/lib/promise.js:42:14)

svsamipillai avatar Oct 06 '17 13:10 svsamipillai

This issue gets resolved when you upgrade node. I used the following:

sudo npm cache clean -f
sudo npm install -g n
sudo n stable

svsamipillai avatar Oct 06 '17 14:10 svsamipillai

@svsamipillai that didn't work for me. I have changed Dockerfile to use node:8.6.0 and node:alpine and still having the same error.

ReferenceError: Promise is not defined
   at validator (/usr/src/app/node_modules/har-validator/lib/promise.js:42:14)
   at Object.response (/usr/src/app/node_modules/har-validator/lib/promise.js:110:10)
   at Object.module.exports (/usr/src/app/lib/routes/bins/create.js:46:12)
   at Layer.handle [as handle_request] (/usr/src/app/node_modules/express/lib/router/layer.js:95:5)
   at next (/usr/src/app/node_modules/express/lib/router/route.js:131:13)
   at IncomingMessage.<anonymous> (/usr/src/app/lib/middleware/body-parser.js:52:9)
   at IncomingMessage.emit (events.js:92:17)
   at _stream_readable.js:944:16
   at process._tickCallback (node.js:458:13)

orasik avatar Oct 09 '17 09:10 orasik

I have fixed this and changed Dockerfile to docker-compose so you can easily change ports and update configuration. Please check pull request

orasik avatar Oct 09 '17 17:10 orasik