Skip to content

Conversation

@heath-freenome
Copy link
Member

Reasons for making this change

Made build-time fix for the issue attempting to be fixed by #4871

  • Added new antdIconsReplacer.ts to fix up @antd/icons to add .js onto them
  • Updated @rjsf/antd to add antdIconsReplacer.ts to the compileReplacers script, tsconfig.build.json and tsconfig.replacer.json
  • Updated CHANGELOG.md accordingly

Checklist

  • I'm updating documentation
  • I'm adding or updating code
    • I've added and/or updated tests. I've run npx nx run-many --target=build --exclude=@rjsf/docs && npm run test:update to update snapshots, if needed.
    • I've updated docs if needed
    • I've updated the changelog with a description of the PR
  • I'm adding a new feature
    • I've updated the playground with an example use of the feature

Made build-time fix for the issue attempting to be fixed by rjsf-team#4871
- Added new `antdIconsReplacer.ts` to fix up `@antd/icons` to add `.js` onto them
- Updated `@rjsf/antd` to add `antdIconsReplacer.ts` to the `compileReplacers` script, `tsconfig.build.json` and `tsconfig.replacer.json`
- Updated `CHANGELOG.md` accordingly
@nickgros nickgros merged commit d4dfdde into rjsf-team:main Nov 14, 2025
5 checks passed
@selaux
Copy link

selaux commented Nov 15, 2025

Just tested this out and unfortunately it does not work as expected. It now throws an error with 6.1.1 when rendering the a form with an array inside of it:

renderer.dev.js:512618 Uncaught Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.

Check the render method of `MoveUpButton`.
    at createFiberFromTypeAndProps (renderer.dev.js:512618:28)
    at createFiberFromElement (renderer.dev.js:512632:14)
    at reconcileChildFibersImpl (renderer.dev.js:516238:31)
    at renderer.dev.js:516416:33
    at reconcileChildren (renderer.dev.js:516980:13)
    at beginWork (renderer.dev.js:519152:13)
    at runWithFiberInDEV (renderer.dev.js:509879:30)
    at performUnitOfWork (renderer.dev.js:523491:22)
    at workLoopSync (renderer.dev.js:523315:41)
    at renderRootSync (renderer.dev.js:523295:11)

Not sure what is going on. Looking through the code everything looks fine ^^.

@heath-freenome
Copy link
Member Author

When you debug, what is the value of the iconType prop?

@selaux
Copy link

selaux commented Nov 16, 2025

It's now the content including the default property for me. So { default: WhateverTheIconIs }. This seems to be true for both webpack and vite. For webpack I found the workaround to add the following to rules:

{
    test: /\.m?js$/,
    type: 'javascript/auto',
},

@heath-freenome heath-freenome deleted the fix-antd-icons branch November 16, 2025 19:26
@heath-freenome
Copy link
Member Author

@selaux so the iconType value from the props is the imported object from the WhateverTheIconIs file? That seems odd, I would have expected it to be default or primary, the only two values specified

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

Successfully merging this pull request may close these issues.

3 participants