Yarn Build Error: Chunk.entrypoints: Use Chunks.groupsIterable and filter by instanceof Entrypoint instead

Hi all. I’ve just gone from sage 8 to my first project using sage 9. I’m having a nightmare with yarn. When I run yarn build I get the following output:

(node:29800) DeprecationWarning: Tapable.plugin is deprecated. Use new API on .hooks instead
 10% building modules 2/5 modules 3 active ...theme/resources/assets/styles/main.scss(node:29800) DeprecationWarning: Tapable.apply is deprecated. Call apply on the plugin directly instead
 77% module and chunk tree optimization unnamed compat plugin/Users/ralphonz/Sites/Projects/Rastafairies/2018.Website/5.Site/public_html/wp-content/themes/rastatheme/node_modules/webpack/lib/Chunk.js:827
		throw new Error(
		^

Error: Chunk.entrypoints: Use Chunks.groupsIterable and filter by instanceof Entrypoint instead
    at Chunk.get (/Users/ralphonz/Sites/Projects/Rastafairies/2018.Website/5.Site/public_html/wp-content/themes/rastatheme/node_modules/webpack/lib/Chunk.js:827:9)
    at /Users/ralphonz/Sites/Projects/Rastafairies/2018.Website/5.Site/public_html/wp-content/themes/rastatheme/node_modules/extract-text-webpack-plugin/dist/index.js:176:48
    at Array.forEach (<anonymous>)
    at /Users/ralphonz/Sites/Projects/Rastafairies/2018.Website/5.Site/public_html/wp-content/themes/rastatheme/node_modules/extract-text-webpack-plugin/dist/index.js:171:18
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/ralphonz/Sites/Projects/Rastafairies/2018.Website/5.Site/public_html/wp-content/themes/rastatheme/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:12:1)
    at AsyncSeriesHook.lazyCompileHook (/Users/ralphonz/Sites/Projects/Rastafairies/2018.Website/5.Site/public_html/wp-content/themes/rastatheme/node_modules/tapable/lib/Hook.js:154:20)
    at Compilation.seal (/Users/ralphonz/Sites/Projects/Rastafairies/2018.Website/5.Site/public_html/wp-content/themes/rastatheme/node_modules/webpack/lib/Compilation.js:1215:27)
    at hooks.make.callAsync.err (/Users/ralphonz/Sites/Projects/Rastafairies/2018.Website/5.Site/public_html/wp-content/themes/rastatheme/node_modules/webpack/lib/Compiler.js:541:17)
    at _done (eval at create (/Users/ralphonz/Sites/Projects/Rastafairies/2018.Website/5.Site/public_html/wp-content/themes/rastatheme/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:9:1)
    at _err0 (eval at create (/Users/ralphonz/Sites/Projects/Rastafairies/2018.Website/5.Site/public_html/wp-content/themes/rastatheme/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:20:22)
    at _addModuleChain (/Users/ralphonz/Sites/Projects/Rastafairies/2018.Website/5.Site/public_html/wp-content/themes/rastatheme/node_modules/webpack/lib/Compilation.js:1066:12)
    at processModuleDependencies.err (/Users/ralphonz/Sites/Projects/Rastafairies/2018.Website/5.Site/public_html/wp-content/themes/rastatheme/node_modules/webpack/lib/Compilation.js:982:9)
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickCallback (internal/process/next_tick.js:180:9)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

`
I’m really not sure how to resolve this as I’ve never used yarn before. Can anyone provide a clue as to how to solve this error?

Thanks in advance!

Have you tried Google? The first result for your error is this GitHub issue that offers some insight: https://github.com/webpack/webpack/issues/6568

Is this a fresh Sage installation? Have you added or removed anything? It looks like this might be related to webpack 4, which Sage doesn’t support yet: https://github.com/roots/sage/issues/2102

Humm, it’s a fresh install. It seems to insist on using webpack 4… Oh well, I might just scrap it and try again.

Not sure what happened but I just started again with another fresh install and everything worked just fine.

I was having the exact same issue. What fixed it for me was to first run npm install from the theme directory. After that I can run yarn build and it will succceed.