Skip to content
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

application/octet-stream #15

Closed
daryl opened this issue Dec 7, 2016 · 2 comments
Closed

application/octet-stream #15

daryl opened this issue Dec 7, 2016 · 2 comments

Comments

@daryl
Copy link

daryl commented Dec 7, 2016

Unless I set a header, it's forcing application/octet-stream, which causes my page to download.

app.use(async (ctx) => {
  ctx.res.setHeader('Content-Type', 'text/html');
  ctx.body = '...';
});

Can this be avoided?

@shellscape
Copy link
Owner

This is more likely a symptom of koa2 rather than koa-webpack. When you run the app in production mode, without koa-webpack, do you get the same issue? If so, then it's koa2. If not, then it's koa-webpack.

@shellscape
Copy link
Owner

Try adding headers to your dev config. eg:

    dev: {
      publicPath: config.output.publicPath,
      headers: { 'Content-Type': 'text/html; charset=utf-8' },
      stats: { colors: true },
      quiet: false,
      noInfo: true
    },

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

No branches or pull requests

2 participants