0

the code of webpack4 bootstarp in development mode.

/******/   (function(modules) { // webpackBootstrap
            ...
/******/    function hotCreateRequire(moduleId) {
/******/        var me = installedModules[moduleId];
/******/        if (!me) return __webpack_require__;
/******/        var fn = function(request) {
/******/            if (me.hot.active) {
/******/                if (installedModules[request]) {
                            // here use 'includes' not supported in es5 
/******/                    if (!installedModules[request].parents.includes(moduleId))

And my development enviroment is not chrome, it didn't support these new features.

So how can i solve it ?

Or I have to use webpack3?

Zhendong
  • 99
  • 6
  • 1
    Possible duplicate of [Array.prototype.includes - not transformed with babel](https://stackoverflow.com/questions/43462708/array-prototype-includes-not-transformed-with-babel) - you need a polyfill. – Joe Clay Mar 16 '18 at 11:33
  • The code is produced by webpack, not my business code. And with webpack3, it can run without error. – Zhendong Mar 16 '18 at 11:43

1 Answers1

0

Sean from the webpack team. We had this reported (PS: this is something you should be reporting as a bug to our project, not general usage questions which should land on SO).

We have also opened this issue which will aim to ensure that the runtime we produce is always backwards compatible ES5. (That link also has the link to merged PR where we have fixed this issue)

Sean Larkin
  • 6,290
  • 1
  • 28
  • 43