Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Merge requests
  • !9872

fix(react-scripts): add missing peer dependency react and update react-refresh-webpack-plugin

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/merceyz/merceyz/dependency-issues into master Oct 23, 2020
  • Overview 9
  • Commits 5
  • Pipelines 0
  • Changes 1

Created by: merceyz

What's the problem this PR addresses?

  • react-scripts has a missing peer dependency on react
  • react-scripts depends on a version of @pmmmwh/react-refresh-webpack-plugin which doesn't resolve the imports it injects causing projects to rely on hoisting to bring react-refresh to the root node_modules folder which is not guaranteed.
  • The templates lack a dependency on eslint-config-react-app making it also rely on hoisting. Delayed for another time

Read https://yarnpkg.com/advanced/rulebook#packages-should-only-ever-require-what-they-formally-list-in-their-dependencies for more in depth information about hoisting.

Fixes https://github.com/yarnpkg/berry/runs/1299440256#step:5:132 Fixes https://github.com/facebook/create-react-app/issues/9446 Fixes https://github.com/pnpm/pnpm/issues/2957 Closes https://github.com/facebook/create-react-app/pull/9671

How did you fix it?

  • Add a peer dependency on react
  • Add eslint-config-react-app as a dependency in the templates Delayed for another time
  • Update @pmmmwh/react-refresh-webpack-plugin to get https://github.com/pmmmwh/react-refresh-webpack-plugin/pull/230 (cc @pmmmwh)
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/merceyz/merceyz/dependency-issues