Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"react-scripts build" gives webpack error: "Chunk.entrypoints: Use Chunks.addGroup instead" #4356

Closed
ejfrancis opened this issue Apr 24, 2018 · 3 comments

Comments

@ejfrancis
Copy link

Is this a bug report?

Yes

Did you try recovering your dependencies?

Yes

Environment

  1. node -v: 8.2.1
  2. npm -v: 5.6.0
  3. yarn --version (if you use Yarn):
  4. npm ls react-scripts (if you haven’t ejected):

Then, specify:

  1. Operating system: macOS 10.13.4
  2. Browser and version (if relevant):

Steps to Reproduce

(Write your steps here:)

  1. Create repo with older version of react-scripts ~1.0.17
  2. Update react-scripts to 1.1.4
  3. Run react-scripts-build

Expected Behavior

Build works.

Actual Behavior

The following error output occurs when running react-scripts build:

> react-scripts build

Creating an optimized production build...
/Users/myuser/devel/MyTeam/myapp-ui/node_modules/webpack/lib/Chunk.js:533
                throw new Error("Chunk.entrypoints: Use Chunks.addGroup instead");
                ^

Error: Chunk.entrypoints: Use Chunks.addGroup instead
    at Chunk.set (/Users/myuser/devel/MyTeam/myapp-ui/node_modules/webpack/lib/Chunk.js:533:9)
    at /Users/myuser/devel/MyTeam/myapp-ui/node_modules/extract-text-webpack-plugin/dist/index.js:176:40
    at Array.forEach (native)
    at Compilation.<anonymous> (/Users/myuser/devel/MyTeam/myapp-ui/node_modules/extract-text-webpack-plugin/dist/index.js:171:18)
    at Compilation.applyPluginsAsyncSeries (/Users/myuser/devel/MyTeam/myapp-ui/node_modules/react-scripts/node_modules/tapable/lib/Tapable.js:206:13)
    at Compilation.seal (/Users/myuser/devel/MyTeam/myapp-ui/node_modules/react-scripts/node_modules/webpack/lib/Compilation.js:605:8)
    at applyPluginsParallel.err (/Users/myuser/devel/MyTeam/myapp-ui/node_modules/react-scripts/node_modules/webpack/lib/Compiler.js:508:17)
    at /Users/myuser/devel/MyTeam/myapp-ui/node_modules/react-scripts/node_modules/tapable/lib/Tapable.js:289:11
    at _addModuleChain (/Users/myuser/devel/MyTeam/myapp-ui/node_modules/react-scripts/node_modules/webpack/lib/Compilation.js:507:11)
    at processModuleDependencies.err (/Users/myuser/devel/MyTeam/myapp-ui/node_modules/react-scripts/node_modules/webpack/lib/Compilation.js:477:14)
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickCallback (internal/process/next_tick.js:180:9)

Looking at the dependency tree, react-scripts 1.1.3 depends on [email protected], see my output of npm ls extract-text-webpack-plugin

SDGL141befbb9:myapp-ui myuser$ npm list extract-text-webpack-plugin
[email protected] /Users/myuser/devel/MyTeam/myapp-ui
└─┬ [email protected]
  └── [email protected]

In extract-text-plugin on this line we see it accessing chunk.entrypoints (Chunk coming from import Chunk from 'webpack/lib/Chunk';). But if we look at webpack we can see that on this line it throws an error if you try to access chunk.entrypoints.

@Timer
Copy link
Contributor

Timer commented Apr 24, 2018

This sounds like a npm bug, if you rm -rf node_modules and reinstall does it fix this problem?

@halfmatthalfcat
Copy link

Looks related to webpack-contrib/extract-text-webpack-plugin#701.

Running npm install -D extract-text-webpack-plugin@next solved the issue locally for me.

@Timer Timer closed this as completed May 24, 2018
@medaamarnadh
Copy link

Looks related to webpack-contrib/extract-text-webpack-plugin#701.

Running npm install -D extract-text-webpack-plugin@next solved the issue locally for me.

What is the meaning of it ?

@lock lock bot locked and limited conversation to collaborators Jan 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants