Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
},
"dependencies": {
"address": "0.0.3",
"body-parser": "1.0.0",
"connect": "2.12.0",
"body-parser": "1.20.4",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The upgrade of body-parser to version 1.20.4 introduces a breaking API change that will cause the application to crash at startup.

In servers/web.js on line 38, the application uses app.use(bodyParser()). In body-parser versions greater than 1.5.0, this usage is no longer valid. require('body-parser') now returns an object containing middleware functions, so bodyParser() is not a function and will throw a TypeError.

To fix this, you must update servers/web.js to use the new API. The line app.use(bodyParser()); should be replaced with specific parsers, for example:

app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));

This change is necessary for the application to work with the updated dependency.

"connect": "3.0.0",
"connect-multiparty": "1.0.1",
"debug": "0.7.4",
"eventproxy": "0.2.6",
Expand Down
Loading