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

Missing dependencies when using Yarn 2 on razzle 3.x #1524

Closed
icyrockcom opened this issue Jan 12, 2021 · 1 comment
Closed

Missing dependencies when using Yarn 2 on razzle 3.x #1524

icyrockcom opened this issue Jan 12, 2021 · 1 comment

Comments

@icyrockcom
Copy link

🐛 Bug report

Current Behavior

This is from a fresh app created by:

$ yarn create razzle-app --no-install typescript-razzle-require-unsound
$ cd typescript-razzle-require-unsound
$ yarn set version berry
$ yarn install
$ yarn razzle start

A couple dependencies seem to be missing:

Error: @pmmmwh/react-refresh-webpack-plugin tried to access webpack, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.
Error: razzle tried to access postcss-load-config, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.

These can be resolved by adding these in .yarnrc.yml:

packageExtensions:
  "@pmmmwh/react-refresh-webpack-plugin@*":
    peerDependencies:
      webpack: ^5.0.0
  razzle@*:
    dependencies:
      postcss-load-config: ^2.0.0

Expected behavior

Should work out of the box.

Reproducible example

https://github.com/icyrockcom/typescript-razzle-require-unsound

Suggested solution(s)

Upgrading to this release might fix the first one https://github.com/pmmmwh/react-refresh-webpack-plugin/releases/tag/v0.4.3.

Additional context

N/A.

Your environment

Software Version(s)
Razzle 3.3.11
Razzle Plugins None
Node v14.15.4
Browser N/A
npm/Yarn Yarn 2.4.0
Operating System Linux (Xubuntu 20.04.1 LTS)
TypeScript N/A
React N/A
@fivethreeo fivethreeo modified the milestone: 4.0 Jan 14, 2021
@fivethreeo fivethreeo changed the title Missing dependencies when using Yarn 2 Missing dependencies when using Yarn 2 on razzle 3.x Jan 20, 2021
@fivethreeo
Copy link
Collaborator

yarn2 in 3.x will not be supported. In 4.0 I will make razzle and examples installable but yarn2 will require other changes aswell to be useable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants