shellscape / webpack-manifest-plugin

webpack plugin for generating asset manifests
MIT License
1.43k stars 185 forks source link

Chunk.initial was removed. Use canBeInitial/isOnlyInitial() #121

Closed mkg0 closed 6 years ago

mkg0 commented 6 years ago

I'm facing an error when I try to start webpack after the upgrade. My environment like below:

node version: v9.4.0
webpack-manifest-plugin:  v2.0.0-rc.1
webpack version: v4.0.0-beta.2

error trace

/{ProjectRoot}/node_modules/webpack/lib/Chunk.js:70
        throw new Error("Chunk.initial was removed. Use canBeInitial/isOnlyInitial()");
        ^

Error: Chunk.initial was removed. Use canBeInitial/isOnlyInitial()
    at Chunk.get initial [as initial] (/{ProjectRoot}/node_modules/webpack/lib/Chunk.js:70:9)
    at ManifestPlugin.<anonymous> (/{ProjectRoot}/node_modules/webpack-manifest-plugin/lib/plugin.js:63:65)
    at Array.reduce (native)
    at ManifestPlugin.<anonymous> (/{ProjectRoot}/node_modules/webpack-manifest-plugin/lib/plugin.js:49:26)
    at Array.reduce (native)
    at ManifestPlugin.<anonymous> (/{ProjectRoot}/node_modules/webpack-manifest-plugin/lib/plugin.js:48:36)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/{ProjectRoot}/node_modules/tapable/lib/HookCodeFactory.js:24:12), <anonymous>:7:1)
    at AsyncSeriesHook.lazyCompileHook [as _callAsync] (/{ProjectRoot}/node_modules/tapable/lib/Hook.js:35:21)
    at Compiler.emitAssets (/{ProjectRoot}/node_modules/webpack/lib/Compiler.js:301:19)
    at onCompiled (/{ProjectRoot}/node_modules/webpack/lib/Watching.js:49:19)
    at hooks.afterCompile.callAsync.err (/{ProjectRoot}/node_modules/webpack/lib/Compiler.js:452:14)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/{ProjectRoot}/node_modules/tapable/lib/HookCodeFactory.js:24:12), <anonymous>:15:1)
    at AsyncSeriesHook.lazyCompileHook [as _callAsync] (/{ProjectRoot}/node_modules/tapable/lib/Hook.js:35:21)
    at compilation.seal.err (/{ProjectRoot}/node_modules/webpack/lib/Compiler.js:449:30)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/{ProjectRoot}/node_modules/tapable/lib/HookCodeFactory.js:24:12), <anonymous>:6:1)
    at AsyncSeriesHook.lazyCompileHook [as _callAsync] (/{ProjectRoot}/node_modules/tapable/lib/Hook.js:35:21)
error Command failed with exit code 1.
mkg0 commented 6 years ago

for a temporary solution, I updated package with @andriijas's PR: https://github.com/danethurber/webpack-manifest-plugin/pull/118

package.json

"webpack-manifest-plugin": "andriijas/webpack-manifest-plugin"
mastilver commented 6 years ago

closing this as it's should be availble on latest rc2

dreyks commented 6 years ago

FWIW yarn add webpack-manifest-plugin@next still gives me rc1. had to specify rc2 manually, now everything works

mastilver commented 6 years ago

Thank you for raising that, I forgot to tag it correctly... :/

And I don't think I can update it now, so rc.2 is latest

aaronshaf commented 6 years ago

@mastilver Can you publish rc.2 to npm?

mastilver commented 6 years ago

it is

'2.0.0-rc.2': '2018-02-28T23:03:15.733Z'

aaronshaf commented 6 years ago

With 2.0.0-rc.2 I am still getting:

webpack_1      | [./node_modules/webpack/buildin/module.js] (webpack)/buildin/module.js 519 bytes {main} [built]
webpack_1      |     + 713 hidden modules
webpack_1      | /usr/src/app/node_modules/webpack/lib/Chunk.js:72
webpack_1      |        throw new Error(ERR_CHUNK_INITIAL);
webpack_1      |        ^
webpack_1      |
webpack_1      | Error: Chunk.initial was removed. Use canBeInitial/isOnlyInitial()
webpack_1      |     at Chunk.get initial [as initial] (/usr/src/app/node_modules/webpack/lib/Chunk.js:72:9)
webpack_1      |     at ManifestPlugin.<anonymous> (/usr/src/app/client/node_modules/webpack-manifest-plugin/lib/plugin.js:67:66)
aaronshaf commented 6 years ago

Nevermind, figured it out!

jhyman2 commented 5 years ago

Upgrading from "webpack-manifest-plugin": "^1.3.2", to "webpack-manifest-plugin": "^2.0.4", fixed this for me.

jacobmassengill commented 5 years ago

Upgrading from "webpack-manifest-plugin": "^1.3.2", to "webpack-manifest-plugin": "^2.0.4", fixed this for me.

This fixed the issue for me. Thanks!