{"action":"created","issue":{"url":"https://api.github.com/repos/hapijs/joi/issues/1149","repository_url":"https://api.github.com/repos/hapijs/joi","labels_url":"https://api.github.com/repos/hapijs/joi/issues/1149/labels{/name}","comments_url":"https://api.github.com/repos/hapijs/joi/issues/1149/comments","events_url":"https://api.github.com/repos/hapijs/joi/issues/1149/events","html_url":"https://github.com/hapijs/joi/issues/1149","id":219581895,"number":1149,"title":"process.binding is not supported","user":{"login":"renehauck","id":3898144,"avatar_url":"https://avatars1.githubusercontent.com/u/3898144?v=3","gravatar_id":"","url":"https://api.github.com/users/renehauck","html_url":"https://github.com/renehauck","followers_url":"https://api.github.com/users/renehauck/followers","following_url":"https://api.github.com/users/renehauck/following{/other_user}","gists_url":"https://api.github.com/users/renehauck/gists{/gist_id}","starred_url":"https://api.github.com/users/renehauck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/renehauck/subscriptions","organizations_url":"https://api.github.com/users/renehauck/orgs","repos_url":"https://api.github.com/users/renehauck/repos","events_url":"https://api.github.com/users/renehauck/events{/privacy}","received_events_url":"https://api.github.com/users/renehauck/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-04-05T13:26:28Z","updated_at":"2017-06-03T06:56:52Z","closed_at":"2017-06-03T06:56:52Z","body":"#### Context\r\n\r\n* *node version*: v6.9.5\r\n* *joi version*: ^10.4.1\r\n* *environment* : node\r\n* *used with* : hapi, nextjs, typescript\r\n* *any other relevant information*: server-side rendering\r\n\r\n#### What are you trying to achieve or the steps to reproduce ?\r\n\r\n\r\nI have this function:\r\n```js\r\nthis.server.route({\r\n            method: \"POST\",\r\n            path: Routes.Login,\r\n                config: {\r\n                   validate: {\r\n                       payload: {\r\n                           email: Joi.string().email().required(),\r\n                           password: Joi.string().min(5).max(100).required(),\r\n                       }\r\n                   },\r\n               },\r\n            handler: (request, reply) => {\r\n               ...\r\n            }\r\n        })\r\n```\r\n\r\n#### Which result you had ?\r\nwhen I import \"joi\" like this:\r\n\r\n`import * as joi from 'joi'`\r\nor\r\n`import joi from 'joi'`\r\nor\r\n`const joi = require('joi');`\r\n\r\nI get this error:\r\n> process.binding is not supported\r\n>     at Object.process.binding (browser.js?2c72b87:173)\r\n>     at Object.eval (eval at evalScript (eval-script.js?c3c3587:22), <anonymous>:6779:25)\r\n>     at Object.893 (eval at evalScript (eval-script.js?c3c3587:22), <anonymous>:6857:30)\r\n>     at __webpack_require__ (bootstrap 2796216…?8ce1719:693)\r\n>     at fn (bootstrap 2796216…?8ce1719:110)\r\n>     at Object.eval (eval at evalScript (eval-script.js?c3c3587:22), <anonymous>:3158:22)\r\n>     at Object.601 (eval at evalScript (eval-script.js?c3c3587:22), <anonymous>:4753:30)\r\n>     at __webpack_require__ (bootstrap 2796216…?8ce1719:693)\r\n>     at fn (bootstrap 2796216…?8ce1719:110)\r\n>     at Object.<anonymous> (string.js?d42dd4f:5)\r\n\r\nit works when I write the validation like this:\r\n\r\n```\r\n...\r\n config: {\r\n                validate: {\r\n                    payload: {\r\n                        email: require('joi').string().email().required(),\r\n                        password: require('joi').string().min(5).max(100).required()\r\n                    }\r\n                },\r\n            },\r\n...\r\n```\r\n\r\n\r\nIs this a bug, or what am I doing wrong?\r\n\r\nThank you :smiley: \r\n"},"comment":{"url":"https://api.github.com/repos/hapijs/joi/issues/comments/305956651","html_url":"https://github.com/hapijs/joi/issues/1149#issuecomment-305956651","issue_url":"https://api.github.com/repos/hapijs/joi/issues/1149","id":305956651,"user":{"login":"renehauck","id":3898144,"avatar_url":"https://avatars1.githubusercontent.com/u/3898144?v=3","gravatar_id":"","url":"https://api.github.com/users/renehauck","html_url":"https://github.com/renehauck","followers_url":"https://api.github.com/users/renehauck/followers","following_url":"https://api.github.com/users/renehauck/following{/other_user}","gists_url":"https://api.github.com/users/renehauck/gists{/gist_id}","starred_url":"https://api.github.com/users/renehauck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/renehauck/subscriptions","organizations_url":"https://api.github.com/users/renehauck/orgs","repos_url":"https://api.github.com/users/renehauck/repos","events_url":"https://api.github.com/users/renehauck/events{/privacy}","received_events_url":"https://api.github.com/users/renehauck/received_events","type":"User","site_admin":false},"created_at":"2017-06-03T06:56:51Z","updated_at":"2017-06-03T06:56:51Z","body":"Sorry for the late reply, but finally I have found the problem.\r\n\r\n@Marsup you were right.\r\nIn my code, I use the same variable, which contains the route names, \r\non server and client side.\r\nFor this reason, Webpack also tries to put parts of the server into a bundle.\r\nAlso, unfortunately Joi.\r\n\r\nsorry it was my fault :disappointed: \r\n"}}
{"actor":{"display_login":"renehauck"}}