I have two issues when working with Uniforms in a Vite project (Remix | React Router).
JSONSchemaBridgeModule cannot be used as constructor
__vite_ssr_import_2__.default is not a constructor
Named export error from uniforms-unstyled package (could be other themes as well)
[vite] Named export 'AutoForm' not found.
The requested module 'uniforms-unstyled' is a CommonJS module,
which may not support all module.exports as named exports.
Reproduce on codesandbox: https://codesandbox.io/p/devbox/tw9mnm
What I have tried
For the named export issue, I can make it work by changing
- import { AutoForm } from "uniforms-unstyled"
+ import * as Unstyled from "uniforms-unstyled"
- <AutoForm />
+ <Unstyled.AutoForm />
I have two issues when working with Uniforms in a Vite project (Remix | React Router).
JSONSchemaBridgeModule cannot be used as constructor
Named export error from
uniforms-unstyledpackage (could be other themes as well)Reproduce on codesandbox: https://codesandbox.io/p/devbox/tw9mnm
What I have tried
For the named export issue, I can make it work by changing