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

1.10 requires react 18.2 as a peerDependency. #465

Closed
b6pzeusbc54tvhw5jgpyw8pwz2x6gs opened this issue Oct 10, 2023 · 3 comments
Closed
Labels
bug Something isn't working

Comments

@b6pzeusbc54tvhw5jgpyw8pwz2x6gs
Copy link
Contributor

What platform is your computer?

MacOS

How did you attempt to install or upgrade?

$ npm install

What do you see instead?

npm WARN ERESOLVE overriding peer dependency
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: @kubb/[email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR!   peer react@">=18.2.0" from @kubb/[email protected]
npm ERR!   node_modules/@kubb/swagger-client/node_modules/@kubb/react-template
npm ERR!     @kubb/react-template@"1.10.0" from @kubb/[email protected]
npm ERR!     node_modules/@kubb/swagger-client
npm ERR!       dev @kubb/swagger-client@"^1.9.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peerOptional react@"^18.2.0" from @kubb/[email protected]
npm ERR! node_modules/@kubb/swagger-client
npm ERR!   dev @kubb/swagger-client@"^1.9.1" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: [email protected]
npm ERR! node_modules/react
npm ERR!   peerOptional react@"^18.2.0" from @kubb/[email protected]
npm ERR!   node_modules/@kubb/swagger-client
npm ERR!     dev @kubb/swagger-client@"^1.9.1" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR!
npm ERR! For a full report see:
npm ERR! /Users/alfred/.npm/_logs/2023-10-10T09_29_55_379Z-eresolve-report.txt
npm ERR! A complete log of this run can be found in: /Users/alfred/.npm/_logs/2023-10-10T09_29_55_379Z-debug-0.log

Additional information

I'm using react 17, no problem with kubb 1.9, but with 1.10 I'm getting an error that it conflicts with react 18 peerDependency.

I can use the --force or --legacy-peer-deps option, but this will also disable other peerDependency checks, so if possible, I would like kubb to not have react 18 as a peerDependency. Why does kubb use react 18 as a peerDependency? Is it possible to remove react 18 as a peerDependency?

@b6pzeusbc54tvhw5jgpyw8pwz2x6gs b6pzeusbc54tvhw5jgpyw8pwz2x6gs added the bug Something isn't working label Oct 10, 2023
@stijnvanhulle
Copy link
Collaborator

@b6pzeusbc54tvhw5jgpyw8pwz2x6gs For an upcoming feature(@kubb/react-template) I started using React to make it possible to override the templates that are getting used to create the client/axios, React-Query, Vue-Query,.. files.

But indeed that should not be as part of a peerDependency. I will open a PR soon to fix this :)

@stijnvanhulle
Copy link
Collaborator

@b6pzeusbc54tvhw5jgpyw8pwz2x6gs Version 1.10.1 has been released :)

@b6pzeusbc54tvhw5jgpyw8pwz2x6gs
Copy link
Contributor Author

The npm install command completes with the following warning.

$ npm install
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: [email protected]
npm WARN Found: [email protected]
npm WARN node_modules/react
npm WARN   peer react@">=16.8.0" from @emotion/[email protected]
npm WARN   node_modules/@emotion/react
npm WARN     @emotion/react@"^11.8.1" from [email protected]
npm WARN     node_modules/react-select
npm WARN   41 more (@emotion/use-insertion-effect-with-fallbacks, ...)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer react@"^18.2.0" from [email protected]
npm WARN node_modules/@kubb/react-template/node_modules/react-reconciler
npm WARN   react-reconciler@"^0.29.0" from @kubb/[email protected]
npm WARN   node_modules/@kubb/react-template
npm WARN 
npm WARN Conflicting peer dependency: [email protected]
npm WARN node_modules/react
npm WARN   peer react@"^18.2.0" from [email protected]
npm WARN   node_modules/@kubb/react-template/node_modules/react-reconciler
npm WARN     react-reconciler@"^0.29.0" from @kubb/[email protected]
npm WARN     node_modules/@kubb/react-template
npm WARN deprecated @types/[email protected]: This is a stub types definition. nock provides its own type definitions, so you do not need this installed.
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142

However, the generate command throws an error.

> kubb generate --config kubb-configs/kubb.config.ts

✔ 💾 Config loaded(kubb-configs/kubb.config.ts)
✖ Something went wrong

  PluginError: Cannot read properties of undefined (reading 'isBatchingLegacy') (plugin: swagger-client, hook: buildStart)



  Plugins:      0 failed, 3 total
Generated:      41 files
     Time:      0.258s
   Output:      /Users/alfred/***/***/server/generated-api/***

Reinstall react to 18 and run it and it should work.

npm uninstall react
npm install react
kubb generate --config kubb-configs/kubb.config.ts
> kubb generate --config kubb-configs/kubb.config.ts

✔ 💾 Config loaded(kubb-configs/kubb.config.ts)
✔ 🚀 Build completed 


  Plugins:      4 successful, 4 total
Generated:      91 files
     Time:      0.363s
   Output:      /Users/alfred/***/***/server/generated-api/***

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants