{"action":"created","issue":{"url":"https://api.github.com/repos/expressjs/body-parser/issues/124","labels_url":"https://api.github.com/repos/expressjs/body-parser/issues/124/labels{/name}","comments_url":"https://api.github.com/repos/expressjs/body-parser/issues/124/comments","events_url":"https://api.github.com/repos/expressjs/body-parser/issues/124/events","html_url":"https://github.com/expressjs/body-parser/issues/124","id":106090088,"number":124,"title":"Latest BodyParser does not work with Express 4.13.3 static views","user":{"login":"samuelkilada","id":8445353,"avatar_url":"https://avatars.githubusercontent.com/u/8445353?v=3","gravatar_id":"","url":"https://api.github.com/users/samuelkilada","html_url":"https://github.com/samuelkilada","followers_url":"https://api.github.com/users/samuelkilada/followers","following_url":"https://api.github.com/users/samuelkilada/following{/other_user}","gists_url":"https://api.github.com/users/samuelkilada/gists{/gist_id}","starred_url":"https://api.github.com/users/samuelkilada/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samuelkilada/subscriptions","organizations_url":"https://api.github.com/users/samuelkilada/orgs","repos_url":"https://api.github.com/users/samuelkilada/repos","events_url":"https://api.github.com/users/samuelkilada/events{/privacy}","received_events_url":"https://api.github.com/users/samuelkilada/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"dougwilson","id":67512,"avatar_url":"https://avatars.githubusercontent.com/u/67512?v=3","gravatar_id":"","url":"https://api.github.com/users/dougwilson","html_url":"https://github.com/dougwilson","followers_url":"https://api.github.com/users/dougwilson/followers","following_url":"https://api.github.com/users/dougwilson/following{/other_user}","gists_url":"https://api.github.com/users/dougwilson/gists{/gist_id}","starred_url":"https://api.github.com/users/dougwilson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dougwilson/subscriptions","organizations_url":"https://api.github.com/users/dougwilson/orgs","repos_url":"https://api.github.com/users/dougwilson/repos","events_url":"https://api.github.com/users/dougwilson/events{/privacy}","received_events_url":"https://api.github.com/users/dougwilson/received_events","type":"User","site_admin":false},"milestone":null,"comments":7,"created_at":"2015-09-11T20:41:30Z","updated_at":"2015-09-11T21:45:50Z","closed_at":"2015-09-11T21:36:09Z","body":"I have a web app set up with express.static as the rendering engine. Anytime I do a form POST, whether I handle it or not I get:\r\n```\r\n\"TypeError: Cannot call method 'toLowerCase' of undefined\"\r\n...at line 169 of urlencoded.js.\r\n```\r\nIf I revert to bodyparser 1.6.7 it works just fine."},"comment":{"url":"https://api.github.com/repos/expressjs/body-parser/issues/comments/139668622","html_url":"https://github.com/expressjs/body-parser/issues/124#issuecomment-139668622","issue_url":"https://api.github.com/repos/expressjs/body-parser/issues/124","id":139668622,"user":{"login":"dougwilson","id":67512,"avatar_url":"https://avatars.githubusercontent.com/u/67512?v=3","gravatar_id":"","url":"https://api.github.com/users/dougwilson","html_url":"https://github.com/dougwilson","followers_url":"https://api.github.com/users/dougwilson/followers","following_url":"https://api.github.com/users/dougwilson/following{/other_user}","gists_url":"https://api.github.com/users/dougwilson/gists{/gist_id}","starred_url":"https://api.github.com/users/dougwilson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dougwilson/subscriptions","organizations_url":"https://api.github.com/users/dougwilson/orgs","repos_url":"https://api.github.com/users/dougwilson/repos","events_url":"https://api.github.com/users/dougwilson/events{/privacy}","received_events_url":"https://api.github.com/users/dougwilson/received_events","type":"User","site_admin":false},"created_at":"2015-09-11T21:45:50Z","updated_at":"2015-09-11T21:45:50Z","body":"Just tried Node.js 4.0 and it works 100% OK as well, I still cannot reproduce:\r\n```\r\n$ node -v\r\nv4.0.0\r\n\r\n$ npm i express body-parser\r\nbody-parser@1.13.3 node_modules\\body-parser\r\n├── bytes@2.1.0\r\n├── content-type@1.0.1\r\n├── depd@1.0.1\r\n├── qs@4.0.0\r\n├── raw-body@2.1.2 (unpipe@1.0.0)\r\n├── on-finished@2.3.0 (ee-first@1.1.1)\r\n├── http-errors@1.3.1 (inherits@2.0.1, statuses@1.2.1)\r\n├── debug@2.2.0 (ms@0.7.1)\r\n├── type-is@1.6.8 (media-typer@0.3.0, mime-types@2.1.6)\r\n└── iconv-lite@0.4.11\r\n\r\nexpress@4.13.3 node_modules\\express\r\n├── methods@1.1.1\r\n├── escape-html@1.0.2\r\n├── merge-descriptors@1.0.0\r\n├── cookie@0.1.3\r\n├── cookie-signature@1.0.6\r\n├── array-flatten@1.1.1\r\n├── fresh@0.3.0\r\n├── range-parser@1.0.2\r\n├── utils-merge@1.0.0\r\n├── vary@1.0.1\r\n├── path-to-regexp@0.1.7\r\n├── etag@1.7.0\r\n├── content-disposition@0.5.0\r\n├── content-type@1.0.1\r\n├── parseurl@1.3.0\r\n├── serve-static@1.10.0\r\n├── depd@1.0.1\r\n├── on-finished@2.3.0 (ee-first@1.1.1)\r\n├── finalhandler@0.4.0 (unpipe@1.0.0)\r\n├── debug@2.2.0 (ms@0.7.1)\r\n├── qs@4.0.0\r\n├── send@0.13.0 (destroy@1.0.3, statuses@1.2.1, mime@1.3.4, ms@0.7.1, http-errors@1.3.1)\r\n├── proxy-addr@1.0.8 (forwarded@0.1.0, ipaddr.js@1.0.1)\r\n├── type-is@1.6.8 (media-typer@0.3.0, mime-types@2.1.6)\r\n└── accepts@1.2.13 (negotiator@0.5.3, mime-types@2.1.6)\r\n\r\n$ cat app.js\r\n// Load modules\r\nvar http = require('http');\r\nvar express = require('express')\r\nvar bodyParser = require('body-parser');\r\n\r\n// App settings\r\nvar app = express();\r\napp.set('env', 'development');\r\napp.set('port', 1337);\r\napp.use(express.static(__dirname + '/views'));\r\napp.use(bodyParser.json());\r\napp.use(bodyParser.urlencoded({ extended: true }));\r\nvar router = express.Router();\r\napp.use('/', router);\r\nrouter.post('/', function (req, res){\r\n    res.send('got: ' + JSON.stringify(req.body))\r\n})\r\n\r\n// Start the server\r\nhttp.createServer(app).listen(app.get('port'), function () {\r\n    console.log('Express server listening on port ' + app.get('port'));\r\n});\r\n\r\n$ cat views/index.html\r\n<h1>hi!</h1>\r\n<form method=post>\r\n<input name=\"yes\">\r\n<input type=submit value=Go>\r\n\r\n$ node app.js\r\nExpress server listening on port 1337\r\n```\r\n\r\nLoading http://127.0.0.1:1337/ from the above session gives me the form and typing \"no\" into the input and clicking on \"Go\" gives me the following page:\r\n```\r\ngot: {\"yes\":\"no\"}\r\n```\r\n\r\nUnfortunately I'll have to keep this issue for two reasons:\r\n\r\n1. I cannot reproduce at all, given all the information so far. I tried to provide as complete information on exactly how I am reproducing as possible, so I don't have much to do unless you can return the favor :)\r\n2. There is no way `try { throw new Error() } catch (e) { return }` can ever throw an error in JavaScript. If it does, something is seriously broken on your end...\r\n\r\nLet me know how I can reproduce the issue, and we can proceed further :)!"}}