question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Got error ---"EventSource's response has a MIME type ("text/html") that is not "text/event-stream". Aborting the connection."

See original GitHub issue

Hi, I got the following error in browser when using this middleware, any idea what it mean?

EventSource's response has a MIME type ("text/html") that is not "text/event-stream". Aborting the connection.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:7
  • Comments:14

github_iconTop GitHub Comments

20reactions
pburtchaellcommented, Oct 2, 2015

I also have this issue. My server setup looks like this:

var path = require('path');
var express = require('express');
var webpack = require('webpack');
var config = require('./webpack.local.config');

var port = process.env.PORT || config.devPort;
var address = config.devAddress;

var app = express();
var compiler = webpack(config);

// Logging
app.use(require('morgan')('short'));

app.use(require('webpack-dev-middleware')(compiler, {
  noInfo: true,
  publicPath: config.output.publicPath
}));

app.get('*', function (req, res) {
  res.sendFile(path.join(__dirname, 'app/local.html'));
});

app.use(require('webpack-hot-middleware')(compiler));

app.listen(port, address, function (error) {
  if (error) throw error;

  console.log('server running at http://%s:%d', address, port);
});

EDIT:

I changed my config to this and it worked.

var path = require('path');
var express = require('express');
var webpack = require('webpack');
var config = require('./webpack.local.config');

var port = process.env.PORT || config.devPort;
var address = config.devAddress;

var app = express();
var compiler = webpack(config);

// Logging
app.use(require('morgan')('short'));

app.use(require('webpack-dev-middleware')(compiler, {
  noInfo: true,
  publicPath: config.output.publicPath
}));

app.use(require('webpack-hot-middleware')(compiler, {
  log: console.log,
  path: '/__webpack_hmr',
  heartbeat: 10 * 1000
}));

app.get('*', function (req, res) {
  res.sendFile(path.join(__dirname, 'app/local.html'));
});

app.listen(port, address, function (error) {
  if (error) throw error;

  console.log('server running at http://%s:%d', address, port);
});
16reactions
concubicyclecommented, Jul 20, 2016

I had this error while serving a static index.html (using Express static middleware), and including my js bundle as a script there. As my first webpack entry, I had

'webpack-hot-middleware/client?path=http://localhost:3000/

It started working when I changed it to

'webpack-hot-middleware/client?path=http://localhost:3000/__webpack_hmr',

Read more comments on GitHub >

github_iconTop Results From Across the Web

EventSource's response has a MIME type ("text/html") that is ...
This error occurs when your PHP code outputs text in the wrong format. This may be either a PHP error message (all of...
Read more >
EventSource's response has a MIME type ("text/html") that is ...
I'm having this error on the console: EventSource's response has a MIME type (“text/html”) that is not “text/event-stream”. Aborting the ...
Read more >
EventSource's response has a MIME type ("text ... - YouTrack
EventSource's response has a MIME type ("text/html") that is not "text/event-stream". Aborting the connection. What steps will reproduce the problem?
Read more >
Using EventStream doesn't work because MimeType from ...
EventSource's response has a MIME type ("text/html") that is not "text/event-stream". Aborting the connection. Checking the URL (controller ...
Read more >
[SSE Traditional Client] SSE Connection aborts - OutSystems
... following error in the browser console: "EventSource's response has a MIME type ("text/html") that is not "text/event-stream". Aborting the connection.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found