fabian-hiller / modular-forms

The modular and type-safe form library for SolidJS, Qwik and Preact
https://modularforms.dev
MIT License
1k stars 53 forks source link

solid: cannot use without valibot #255

Open obedm503 opened 6 hours ago

obedm503 commented 6 hours ago

valibot is an optional peer dependency and marked as external in the rollup config but is still imported by the generated esm output target.

To prevent this, the modules that use valibot should not be re-exported by the index.ts file. These files should be accessible via @modular-forms/solid/valibot instead.

image

Related to this:

v0.24.0 has valibot version 1.0.0-beta.0 as a dev dependency but version ^1.0.0 as a peer dependency. But valibot version 1.0.0 does not exist in the npm registry (yet?). This confuses npm and causes it to fail making modular forms impossible to use. This is the error:

npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: @modular-forms/solid@0.24.0
npm WARN Found: valibot@1.0.0-beta.0
npm WARN node_modules/valibot
npm WARN   valibot@"1.0.0-beta.0" from the root project
npm WARN
npm WARN Could not resolve dependency:
npm WARN peerOptional valibot@"^1.0.0" from @modular-forms/solid@0.24.0
npm WARN node_modules/@modular-forms/solid
npm WARN   @modular-forms/solid@"^0.24.0" from the root project
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: @modular-forms/solid@0.24.0
npm WARN Found: valibot@undefined
npm WARN node_modules/valibot
npm WARN   valibot@"1.0.0-beta.0" from the root project
npm WARN
npm WARN Could not resolve dependency:
npm WARN peerOptional valibot@"^1.0.0" from @modular-forms/solid@0.24.0
npm WARN node_modules/@modular-forms/solid
npm WARN   @modular-forms/solid@"^0.24.0" from the root project
npm ERR! code ETARGET
npm ERR! notarget No matching version found for valibot@^1.0.0.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
fabian-hiller commented 5 hours ago

Thank you for creating this issue. I will try to have a look at it on Wednesday. Please downgrade to the previous version in the meantime.