Open jsodeman opened 1 week ago
Please don't use import { yupResolver } from '@primevue/forms/resolvers';
. You need to import from @primevue/forms/resolvers/yup
in 4.2.1. Could you please try it after clearing whole caches?
...The forms library provide built-in resolvers for popular options including Zod, Yup, Joi, Valibot, and Superstruct that can be be imported from @primevue/forms/resolvers/* path.
The whole file of @primevue/forms/resolvers/*
is empty. What does it export...
It uses @primeuix/forms API. https://www.npmjs.com/package/@primevue/forms?activeTab=code
Did you try our sample stackblitz link?
So similar of the name... Just install it and OK!
I cleared the IDE caches and deleted node_modules and package-lock.json.
ESLint: yupResolver not found in '@primevue/ forms/ resolvers/ yup'(import/ named)
The stackblitz linked in the docs has a similar error
Having the same problem trying to import the zodResolver,
Package Versions:
"@primevue/forms": "^4.2.1",
"@primevue/themes": "^4.2.1",
"primevue": "^4.2.1",
Import Statement:
import { zodResolver } from '@primevue/forms/resolvers/zod';
Error:
Module '"@primevue/forms/resolvers/zod"' has no exported member 'zodResolver'.
Describe the bug
Importing the yupResolver results in an error:
"[plugin:vite:import-analysis] Failed to resolve entry for package "@primevue/forms". The package may have incorrect main/module/exports specified in its package.json."
Importing the yupResolver by pointing to the yup sub-folder works, though the IDE shows an error
So it looks like the resolver isn't being passed up to the top level exports from the resolvers library.
Reproducer
https://stackblitz.com/edit/primevue-4-vite-issue-template-6bfxlz?file=src%2FApp.vue
PrimeVue version
4.2.1
Vue version
4.x
Language
ES6
Build / Runtime
Vite
Browser(s)
No response
Steps to reproduce the behavior
import { yupResolver } from '@primevue/forms/resolvers';
Expected behavior
No response