NodeJs app runs fine locally - but dumps when deployed to Edge

Not applicable

This code here is a simple web server to host my html application. Runs perfect on my local host.

var express = require('express');
var app = express();


var oneDay = 86400000;


app.use(express.compress());


app.use(express.static(__dirname + '/public', {
    maxAge: oneDay
}));


app.listen(process.env.PORT || 3000);

Deploys on Edge. But errors out when called.

Aug 26, 2015 5:44:59 PMstderrsvr.340*** Error in Node.js script: "Cannot find function _implicitHeader in object [object Object].": TypeError: Cannot find function _implicitHeader in object [object Object]. at /node_modules/express/node_modules/connect/lib/middleware/compress.js:106 at write (_stream_readable.js:601) at flow (_stream_readable.js:610) at pipeOnReadable (_stream_readable.js:642) at emit (events.js:92) at emitReadable_ (_stream_readable.js:426) at emitReadable (_stream_readable.js:422) at readableAddChunk (_stream_readable.js:165) at _stream_readable.js:127 at onread (fs.js:1574) at wrapper (fs.js:465) at submitDomainTick (trireme.js:833)
Solved Solved
0 2 621
1 ACCEPTED SOLUTION

Hi @tetadmin, the express compress module depends on an undocumented _implicitHeader function that the Trireme does not implement. More details (and a workaround) here: https://github.com/apigee/trireme/issues/124

View solution in original post

2 REPLIES 2

Hi @tetadmin, the express compress module depends on an undocumented _implicitHeader function that the Trireme does not implement. More details (and a workaround) here: https://github.com/apigee/trireme/issues/124

Not applicable
If you are running in the Apigee cloud then this will be fixed soon. In the meantime, you can try the "monkey-patch" referenced by Dibyo, which should get you going.