Skip to content

use res.send instead of res.end to enable etag. #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 12, 2016

Conversation

kgdev
Copy link

@kgdev kgdev commented Feb 11, 2015

use res.send instead of res.end to enable etag.

use res.send instead of res.end to enable etag.
@bebraw
Copy link

bebraw commented Jan 9, 2016

👍

sokra added a commit that referenced this pull request Jan 12, 2016
use res.send instead of res.end to enable etag.
@sokra sokra merged commit 5092585 into webpack:master Jan 12, 2016
@sokra
Copy link
Member

sokra commented Jan 12, 2016

Thanks

@hzoo hzoo mentioned this pull request Jan 22, 2016
@mgol
Copy link

mgol commented Jan 22, 2016

This breaks using the dev server as a middleware for browser-sync:

var config = {/*...*/}
var server = require('browser-sync');
var compiler = webpack(config);

serve({
    port: process.env.PORT || 3000,
    open: false,
    server: {baseDir: 'server/dist/'},
    middleware: [
        webpackDevMiddleware(compiler, {
            stats: {
                chunks: false,
                modules: false,
            },
            publicPath: config.output.publicPath,
        }),
    ],
});

It worked fine with [email protected] but with 1.5.0 I get:

TypeError: res.send is not a function
    at processRequest (/Users/mgol/Documents/projects/yougov/entities-manager/node_modules/webpack-dev-middleware/middleware.js:189:8)
    at ready (/Users/mgol/Documents/projects/yougov/entities-manager/node_modules/webpack-dev-middleware/middleware.js:96:20)
    at webpackDevMiddleware (/Users/mgol/Documents/projects/yougov/entities-manager/node_modules/webpack-dev-middleware/middleware.js:162:3)
    at call (/Users/mgol/Documents/projects/yougov/entities-manager/node_modules/connect/index.js:239:7)
    at next (/Users/mgol/Documents/projects/yougov/entities-manager/node_modules/connect/index.js:183:5)
    at respModifierMiddleware (/Users/mgol/Documents/projects/yougov/entities-manager/node_modules/resp-modifier/index.js:80:9)
    at call (/Users/mgol/Documents/projects/yougov/entities-manager/node_modules/connect/index.js:239:7)
    at next (/Users/mgol/Documents/projects/yougov/entities-manager/node_modules/connect/index.js:183:5)
    at next (/Users/mgol/Documents/projects/yougov/entities-manager/node_modules/connect/index.js:161:14)
    at next (/Users/mgol/Documents/projects/yougov/entities-manager/node_modules/connect/index.js:161:14)
    at utils.handleOldIE (/Users/mgol/Documents/projects/yougov/entities-manager/node_modules/browser-sync/lib/server/utils.js:95:16)
    at call (/Users/mgol/Documents/projects/yougov/entities-manager/node_modules/connect/index.js:239:7)
    at next (/Users/mgol/Documents/projects/yougov/entities-manager/node_modules/connect/index.js:183:5)
    at next (/Users/mgol/Documents/projects/yougov/entities-manager/node_modules/connect/index.js:161:14)
    at Function.handle (/Users/mgol/Documents/projects/yougov/entities-manager/node_modules/connect/index.js:186:3)
    at Server.app (/Users/mgol/Documents/projects/yougov/entities-manager/node_modules/connect/index.js:51:37)
TypeError: res.send is not a function
    at processRequest (/Users/mgol/Documents/projects/yougov/entities-manager/node_modules/webpack-dev-middleware/middleware.js:189:8)
    at ready (/Users/mgol/Documents/projects/yougov/entities-manager/node_modules/webpack-dev-middleware/middleware.js:96:20)
    at webpackDevMiddleware (/Users/mgol/Documents/projects/yougov/entities-manager/node_modules/webpack-dev-middleware/middleware.js:162:3)
    at call (/Users/mgol/Documents/projects/yougov/entities-manager/node_modules/connect/index.js:239:7)
    at next (/Users/mgol/Documents/projects/yougov/entities-manager/node_modules/connect/index.js:183:5)
    at respModifierMiddleware (/Users/mgol/Documents/projects/yougov/entities-manager/node_modules/resp-modifier/index.js:80:9)
    at call (/Users/mgol/Documents/projects/yougov/entities-manager/node_modules/connect/index.js:239:7)
    at next (/Users/mgol/Documents/projects/yougov/entities-manager/node_modules/connect/index.js:183:5)
    at next (/Users/mgol/Documents/projects/yougov/entities-manager/node_modules/connect/index.js:161:14)
    at next (/Users/mgol/Documents/projects/yougov/entities-manager/node_modules/connect/index.js:161:14)
    at utils.handleOldIE (/Users/mgol/Documents/projects/yougov/entities-manager/node_modules/browser-sync/lib/server/utils.js:95:16)
    at call (/Users/mgol/Documents/projects/yougov/entities-manager/node_modules/connect/index.js:239:7)
    at next (/Users/mgol/Documents/projects/yougov/entities-manager/node_modules/connect/index.js:183:5)
    at next (/Users/mgol/Documents/projects/yougov/entities-manager/node_modules/connect/index.js:161:14)
    at Function.handle (/Users/mgol/Documents/projects/yougov/entities-manager/node_modules/connect/index.js:186:3)
    at Server.app (/Users/mgol/Documents/projects/yougov/entities-manager/node_modules/connect/index.js:51:37)

@wgcrouch
Copy link

I get the same error using gulp-connect

sokra added a commit that referenced this pull request Jan 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants