webpack-hot-middleware icon indicating copy to clipboard operation
webpack-hot-middleware copied to clipboard

Example for eventsource-polyfill / IE

Open leiming opened this issue 8 years ago • 13 comments

Could you provide a complete example of working on IE?

I refer the https://github.com/glenjamin/webpack-hot-middleware/issues/13 but it's not work.

leiming avatar Dec 08 '15 02:12 leiming

I don't have easy access to IE, so I won't be able to provide a full working example.

If you have any specific errors then feel free to post more detail

glenjamin avatar Dec 08 '15 07:12 glenjamin

Thanks for replying.

The full code is https://github.com/leiming/pcgame-react-boilerplate/tree/fix-ie

Just use https://github.com/gaearon/react-transform-boilerplate

and install eventsource-polyfill

npm install eventsource-polyfill --save-dev

and add eventsource-polyfill.js to entries:

// webpack.config.dev.js
// ...
module.exports = {
  devtool: 'eval',
  entry: [
    'eventsource-polyfill',
    'webpack-hot-middleware/client',
    './src/index'
  ],
// ...

and the error as follow:

** 日志: polyfill-eventsource added missing EventSource to window **

errpr

It is running in the virtual machine of Parallels that use IE 8 in windows 7.

leiming avatar Dec 08 '15 09:12 leiming

If anyone is able to contribute an example including the polyfill for IE, please do.

glenjamin avatar Jan 10 '16 10:01 glenjamin

Just tested in IE11. The modified webpack config provided by @leiming is working perfectly. ** 日志: polyfill-eventsource added missing EventSource to window ** is not an error, just an that the polyfill was added successfully.

@leiming: I suspect the errors lie somewhere else in your application.

cl1ck avatar Jan 20 '16 08:01 cl1ck

@cl1ck , This code is work with IE 11, but IE 8 in Win7.

leiming avatar Jan 20 '16 08:01 leiming

@leiming I just add the 'event-source-polyfill' to the entry chunk and it works

wuhw avatar Oct 15 '16 07:10 wuhw

use the npm package named 'event-source-polyfill' and add this to entry chunk without any loader or plugin. module.exports = { devtool: 'eval', entry: [ 'event-source-polyfill', 'webpack-hot-middleware/client', './src/index' ] } then it works for me. and I check the eventsource-polyfill's source code and I find some error in it. It could'not exports any thing to the window so that you got the error above.

wuhw avatar Oct 15 '16 07:10 wuhw

this is ready for review

johnjjung avatar Nov 30 '17 23:11 johnjjung

What is?

glenjamin avatar Dec 01 '17 07:12 glenjamin

Lol whoops sorry wrong Issue

johnjjung avatar Dec 01 '17 12:12 johnjjung

I used the 'babel-polyfill' plugin, it also can't work in IE11 , but when 'npm run build',open the local index files ,it works, How strange ?

mtiger95 avatar Jan 19 '18 07:01 mtiger95

but fo me,it doesn't work; I use the 'event-source-polyfill' as the example , I don't know where is wrong?

SuLiang2016 avatar Feb 02 '18 02:02 SuLiang2016

fuck IE

florida0723 avatar May 31 '18 14:05 florida0723