Skip to content

entries[0].files.values is not a function #108

Open
@happy-mei

Description

@happy-mei

this error occurs:

[1] (node:27264) UnhandledPromiseRejectionWarning: TypeError: entries[0].files.values is not a function
[1] at xxx/node_modules/worker-plugin/dist/loader.js:86:59
[1] at compile (xxx/node_modules/webpack/lib/Compiler.js:343:11)
[1] at hooks.afterCompile.callAsync.err (xxx/node_modules/webpack/lib/Compiler.js:681:15)
[1] at AsyncSeriesHook.eval [as callAsync] (eval at create (xxx/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:15:1)
[1] at AsyncSeriesHook.lazyCompileHook (xxx/node_modules/tapable/lib/Hook.js:154:20)
[1] at compilation.seal.err (xxx/node_modules/webpack/lib/Compiler.js:678:31)
[1] at AsyncSeriesHook.eval [as callAsync] (eval at create (xxx/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
[1] at AsyncSeriesHook.lazyCompileHook (xxx/node_modules/tapable/lib/Hook.js:154:20)
[1] at hooks.optimizeAssets.callAsync.err (xxx/node_modules/webpack/lib/Compilation.js:1423:35)
[1] at AsyncSeriesHook.eval [as callAsync] (eval at create (xxx/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
[1] at AsyncSeriesHook.lazyCompileHook (xxx/node_modules/tapable/lib/Hook.js:154:20)
[1] at hooks.optimizeChunkAssets.callAsync.err (xxx/node_modules/webpack/lib/Compilation.js:1414:32)
[1] at _promise0.then._result0 (eval at create (xxx/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:13:1)
[1] at <anonymous>

.values is unsupported in Node versions below 8. So, I suggest .values should be replaced by

var vals = Object.keys(countries).map(function(key) {
    return countries[key];
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions