{"action":"created","issue":{"url":"https://api.github.com/repos/expressjs/express/issues/2994","repository_url":"https://api.github.com/repos/expressjs/express","labels_url":"https://api.github.com/repos/expressjs/express/issues/2994/labels{/name}","comments_url":"https://api.github.com/repos/expressjs/express/issues/2994/comments","events_url":"https://api.github.com/repos/expressjs/express/issues/2994/events","html_url":"https://github.com/expressjs/express/issues/2994","id":154416130,"number":2994,"title":"Cannot read property 'encrypted' of undefined","user":{"login":"cressie176","id":229672,"avatar_url":"https://avatars.githubusercontent.com/u/229672?v=3","gravatar_id":"","url":"https://api.github.com/users/cressie176","html_url":"https://github.com/cressie176","followers_url":"https://api.github.com/users/cressie176/followers","following_url":"https://api.github.com/users/cressie176/following{/other_user}","gists_url":"https://api.github.com/users/cressie176/gists{/gist_id}","starred_url":"https://api.github.com/users/cressie176/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cressie176/subscriptions","organizations_url":"https://api.github.com/users/cressie176/orgs","repos_url":"https://api.github.com/users/cressie176/repos","events_url":"https://api.github.com/users/cressie176/events{/privacy}","received_events_url":"https://api.github.com/users/cressie176/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-12T07:35:48Z","updated_at":"2016-05-12T10:44:11Z","closed_at":null,"body":"Simply requiring express then attempting to safe stringify process causes an exception.\r\n\r\n```js\r\nvar stringify = require('json-stringify-safe')\r\nvar express = require('express')\r\nstringify(process)\r\n```\r\nResult\r\n```\r\nTypeError: Cannot read property 'encrypted' of undefined\r\n    at IncomingMessage.protocol (/Users/steve/Development/guidesmiths/express-bug/node_modules/express/lib/request.js:288:30)\r\n    at Object.stringify (native)\r\n    at stringify (/Users/steve/Development/guidesmiths/express-bug/node_modules/json-stringify-safe/stringify.js:5:15)\r\n    at Object.<anonymous> (/Users/steve/Development/guidesmiths/express-bug/index.js:3:1)\r\n    at Module._compile (module.js:409:26)\r\n    at Object.Module._extensions..js (module.js:416:10)\r\n    at Module.load (module.js:343:32)\r\n    at Function.Module._load (module.js:300:12)\r\n    at Function.Module.runMain (module.js:441:10)\r\n    at startup (node.js:139:18)\r\n```\r\n\r\n```\r\n\"express\": \"^4.13.4\",\r\n\"json-stringify-safe\": \"^5.0.1\"\r\n```"},"comment":{"url":"https://api.github.com/repos/expressjs/express/issues/comments/218722248","html_url":"https://github.com/expressjs/express/issues/2994#issuecomment-218722248","issue_url":"https://api.github.com/repos/expressjs/express/issues/2994","id":218722248,"user":{"login":"tunniclm","id":5011883,"avatar_url":"https://avatars.githubusercontent.com/u/5011883?v=3","gravatar_id":"","url":"https://api.github.com/users/tunniclm","html_url":"https://github.com/tunniclm","followers_url":"https://api.github.com/users/tunniclm/followers","following_url":"https://api.github.com/users/tunniclm/following{/other_user}","gists_url":"https://api.github.com/users/tunniclm/gists{/gist_id}","starred_url":"https://api.github.com/users/tunniclm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tunniclm/subscriptions","organizations_url":"https://api.github.com/users/tunniclm/orgs","repos_url":"https://api.github.com/users/tunniclm/repos","events_url":"https://api.github.com/users/tunniclm/events{/privacy}","received_events_url":"https://api.github.com/users/tunniclm/received_events","type":"User","site_admin":false},"created_at":"2016-05-12T10:44:11Z","updated_at":"2016-05-12T10:44:11Z","body":"Hi @cressie176 -- you are correct, during the stringify of process it attempts to stringify `process.mainModule` which contains information about the whole tree of loaded modules which will include express since you `require()`d it. This includes stringifying the `exports` property of the express module, and it exports `request`. Now, `request` has a number of properties that are dynamically determined via a function (using `defineGetter()`). \r\n\r\nSome of these properties rely on certain values being non-null -- evaluating them outside the context of an application/active connection means some of these values _are_ `null` and generate the `TypeError`s you see.\r\n\r\nI just hacked my local express to include null-checks around the problematic property getters and it is possible to make it work. Does the @expressjs/express-tc have an opinion on whether we should add null-checks for these property getters?"}}