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

Unable to install "@rjsf/antd" theme to project with latest (5.3.1) Ant Design #3507

Closed
4 tasks done
Deemetr opened this issue Mar 15, 2023 · 12 comments · Fixed by #3966
Closed
4 tasks done

Unable to install "@rjsf/antd" theme to project with latest (5.3.1) Ant Design #3507

Deemetr opened this issue Mar 15, 2023 · 12 comments · Fixed by #3966

Comments

@Deemetr
Copy link

Deemetr commented Mar 15, 2023

Prerequisites

What theme are you using?

antd

Version

5.x

Current Behavior

npm ERR! Could not resolve dependency:
npm ERR! peer @ant-design/icons@"^4.0.0" from @rjsf/antd@5.2.1
npm ERR! node_modules/@rjsf/antd
npm ERR!   @rjsf/antd@"5.2.1" from the root project

Expected Behavior

Installed @rjsf/antd package

Steps To Reproduce

  1. Create new React project (Vite)
  2. Install via npm latest Ant Design ui kit (npm install antd)
  3. install @rjsf/antd (npm i @rjsf/antd)

Or

  1. Clone repo https://github.com/Deemetr/-rjsf-antd__issue
  2. cd -rjsf-antd__issue
  3. npm i

Environment

- OS: Windows 11
- Node:18.14.2
- npm:9.5.0

Anything else?

No response

@Deemetr Deemetr added bug needs triage Initial label given, to be assigned correct labels and assigned labels Mar 15, 2023
@Deemetr Deemetr changed the title Unnable to install "@rjsf/antd" theme to project with latest (5.3.1) Ant Design Unable to install "@rjsf/antd" theme to project with latest (5.3.1) Ant Design Mar 15, 2023
@Napalm4577
Copy link

Same here

package.json

"@ant-design/icons": "^5.0.1",
"@rjsf/core": "^5.2.1",

When install npm install @rjsf/antd

npm ERR! Found: @ant-design/icons@5.0.1
npm ERR! node_modules/@ant-design/icons
npm ERR!   @ant-design/icons@"^5.0.1" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @ant-design/icons@"^4.0.0" from @rjsf/antd@5.2.1
npm ERR! node_modules/@rjsf/antd
npm ERR!   @rjsf/antd@"*" from the root project

@heath-freenome
Copy link
Member

@Deemetr @Napalm4577 We would love some help upgrading the antd theme to 5.x. As part-time volunteers who do not use antd theme, we have avoided doing major upgrades of it since we don't know to expect from the newer version. Bonus points if the changes needed to upgrade to the newest release continue to allow our users to use the currently supported release.

@heath-freenome heath-freenome added help wanted awaiting response antd antd related theme issue upgrade and removed needs triage Initial label given, to be assigned correct labels and assigned labels Mar 17, 2023
@fran122157
Copy link

@Deemetr @Napalm4577 We would love some help upgrading the antd theme to 5.x. As part-time volunteers who do not use antd theme, we have avoided doing major upgrades of it since we don't know to expect from the newer version. Bonus points if the changes needed to upgrade to the newest release continue to allow our users to use the currently supported release.

Reading Ant Design V4 to V5 migration guide it seems that the only breaking change introduced in V5 (that affects RJSF Antd theme) is the deprecation of moment.js in favor of day.js

I think this can be removed and instead use the default datepicker exposed by AntD

FYI: Just forced the installation of Antd v5 on my repo which is using RJSF v5, and everything worked out just fine.

@heath-freenome
Copy link
Member

@fran122157 That is good information. How do the default date pickers differ? Also, are you willing to provide a PR for the fix?

@fran122157
Copy link

What I meant is that this generatePicker call used to change Antd default date lib from moment.js to day.js is no longer necessary as Antd already uses day.js in v5

so here and here you could just use the default Antd exported datepicker

@fran122157
Copy link

I have created a PR in my own fork.

There's a change I did not see that was introduced in v5: Removal of less files in Antd codebase.

FYI: The PR is just for reference, I tried to test my changes in the playground but I have to link my local changes with the antd version the playground is using and I do not have the time right now.

Please feel free to use any of these changes

@ganshin-yaroslav
Copy link

May I help with this?

@5idu
Copy link

5idu commented Nov 13, 2023

@heath-freenome Is there any progress?

@heath-freenome
Copy link
Member

@5idu Can you try the latest 5.x release, I believe #3849 completed the work

@Gam3sFan
Copy link

I still get the error with the last version:

npm ERR! While resolving: redplanetai@0.1.0
npm ERR! Found: @ant-design/icons@5.2.6
npm ERR! node_modules/@ant-design/icons
npm ERR!   @ant-design/icons@"^5.2.6" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @ant-design/icons@"^4.0.0" from @rjsf/antd@5.14.1
npm ERR! node_modules/@rjsf/antd
npm ERR!   @rjsf/antd@"*" from the root project

@heath-freenome
Copy link
Member

@Gam3sFan thanks for catching that. I will update the peer dependencies in the patch release soon

heath-freenome added a commit to heath-freenome/react-jsonschema-form that referenced this issue Nov 17, 2023
Fixes: rjsf-team#3507 to allow v5 `@ant-design/icons`
- Updated the `antd` package.json to add `@ant-design/icons` v5 to the peer dependencies
heath-freenome added a commit to heath-freenome/react-jsonschema-form that referenced this issue Nov 17, 2023
Fixes: rjsf-team#3507 to allow v5 `@ant-design/icons`
- Updated the `antd` package.json to add `@ant-design/icons` v5 to the peer dependencies
- Updated the `CHANGELOG.md` accordinglyl
heath-freenome added a commit that referenced this issue Nov 17, 2023
Fixes: #3507 to allow v5 `@ant-design/icons`
- Updated the `antd` package.json to add `@ant-design/icons` v5 to the peer dependencies
- Updated the `CHANGELOG.md` accordinglyl
@heath-freenome
Copy link
Member

@Gam3sFan The release should be ready in a few hours

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

Successfully merging a pull request may close this issue.

7 participants