File tree Expand file tree Collapse file tree 3 files changed +19
-11
lines changed Expand file tree Collapse file tree 3 files changed +19
-11
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ var service = require('./src/service').getService(config);
4141 * setup a middleware layer to restrict the request body size
4242 * this middleware is called every time a request is sent to the server
4343 */
44- app . use ( bodyParser . json ( { limit : config . requestBodyLimit } ) ) ;
44+ app . use ( express . json ( { limit : config . requestBodyLimit } ) ) ;
4545
4646// identify the target Serverless platform
4747const platformFactory = require ( './platform/platform.js' ) ;
Original file line number Diff line number Diff line change 88 },
99 "license" : " Apache-2.0" ,
1010 "devDependencies" : {
11- "btoa" : " 1.1.2 " ,
11+ "btoa" : " 1.2.1 " ,
1212 "eslint" : " ^5.16.0" ,
1313 "eslint-config-standard" : " ^12.0.0" ,
1414 "eslint-plugin-import" : " ^2.17.2" ,
1515 "eslint-plugin-node" : " ^8.0.1" ,
1616 "eslint-plugin-promise" : " ^4.1.1" ,
1717 "eslint-plugin-standard" : " ^4.0.0" ,
18- "request" : " 2.79.0 "
18+ "request" : " 2.88.2 "
1919 },
2020 "dependencies" : {
21- "openwhisk" : " 3.21.4" ,
22- "body-parser" : " 1.18.3" ,
23- "express" : " 4.16.4" ,
24- "serialize-error" : " 3.0.0" ,
25- "redis" : " 2.8.0" ,
26- "uuid" : " 3.3.0"
21+ "openwhisk" : " 3.21.6" ,
22+ "express" : " 4.17.3" ,
23+ "serialize-error" : " 9.1.0" ,
24+ "redis" : " 4.0.4" ,
25+ "uuid" : " 8.3.2"
2726 }
2827}
Original file line number Diff line number Diff line change @@ -104,8 +104,17 @@ class NodeActionRunner {
104104 if ( ! error ) {
105105 resolve ( { error : { } } ) ;
106106 } else {
107- const serializeError = require ( 'serialize-error' ) ;
108- resolve ( { error : serializeError ( error ) } ) ;
107+ // Replace unsupported require statement with
108+ // dynamically import npm serialize-error package returning a promise
109+ import ( 'serialize-error' )
110+ . then ( module => {
111+ // if serialize-error is imported correctly the function resolves with a serializedError
112+ resolve ( { error : module . serializeError ( error ) } ) ;
113+ } )
114+ . catch ( err => {
115+ // When there is an error to serialize the error object, resolve with the error message
116+ resolve ( { error : err . message } ) ;
117+ } ) ;
109118 }
110119 } ) ;
111120 }
You can’t perform that action at this time.
0 commit comments