stremio-web icon indicating copy to clipboard operation
stremio-web copied to clipboard

Webpack 5 Polyfill Fix

Open Arcitec opened this issue 2 years ago • 2 comments

There are tons of errors because stremio-web relies on Polyfills that existed in Webpack 4 and lower, but no longer exist in Webpack 5.

It can be fixed in two ways. One way is to specifically import the missing libraries.

The other, easier way, is to import a "polyfill" plugin which automatically loads the polyfill libraries into webpack 5.

To do that, here are the necessary changes:

  1. Add node-polyfill-webpack-plugin to package.json dependencies.
  2. Manually edit the webpack.config.js file and paste the following at the top with the other imports:
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin')

3.Scroll down into the module.exports.plugins array, and add this line at the top, above all other plugins:

        new NodePolyfillPlugin(),

With these changes, along with my other ticket changes (#287 and #286) it becomes possible to run stremio-web on the latest Node.

Arcitec avatar Jun 14 '22 01:06 Arcitec

Hello, can I work on this?

gmjimenezc avatar Jul 10 '22 23:07 gmjimenezc

What are the errors you see? How to reproduce this?

nklhtv avatar Jul 29 '22 07:07 nklhtv