primevue
primevue copied to clipboard
Error with Form import
Describe the bug
Version 4.2.5 fails to launch with this error:
`tryout-2 on main [!] via ⬢ v20.18.0 using ☁️ default/ ➜ yarn run dev yarn run v1.22.17 $ nuxt dev [ nuxi 11:50:28 AM] Nuxt 3.16.0 with Nitro 2.11.6 [11:50:28 AM] ➜ Local: http://localhost:3000/ ➜ Network: use --host to expose
[nuxt:tailwindcss 11:50:29 AM] ℹ Using default Tailwind CSS file [11:50:29 AM] ➜ DevTools: press Shift + Option + D in the browser (v2.2.1)
[11:50:30 AM] ℹ Re-optimizing dependencies because lockfile has changed [11:50:30 AM] ✔ Vite client built in 38ms [11:50:30 AM] ✔ Vite server built in 301ms
[11:50:30 AM] ERROR Pre-transform error: Failed to resolve import "@primevue/forms/form?nuxt_component=async&nuxt_component_name=Form&nuxt_component_export=default" from "virtual:nuxt:%2FUsers%2Fjcham%2FGit%2FML%2Ftryout-2%2F.nuxt%2Fcomponents.plugin.mjs". Does the file exist? Plugin: vite:import-analysis File: virtual:nuxt:%2FUsers%2Fjcham%2FGit%2FML%2Ftryout-2%2F.nuxt%2Fcomponents.plugin.mjs:122:23 120| import LazyTag from 'primevue/tag?nuxt_component=async&nuxt_component_name=Tag&nuxt_component_export=default'; 121| import LazyTerminal from 'primevue/terminal?nuxt_component=async&nuxt_component_name=Terminal&nuxt_component_export=default'; 122| import LazyForm from '@primevue/forms/form?nuxt_component=async&nuxt_component_name=Form&nuxt_component_export=default'; | ^ 123| import LazyFormField from '@primevue/forms/formfield?nuxt_component=async&nuxt_component_name=FormField&nuxt_component_export=default'; 124| const lazyGlobalComponents = [
[11:50:31 AM] WARN "@primevue/forms/formfield/style" is imported by "virtual:#primevue-style", but could not be resolved – treating it as an external dependency.
[11:50:31 AM] WARN "@primevue/forms/form/style" is imported by "virtual:#primevue-style", but could not be resolved – treating it as an external dependency.
[nitro 11:50:32 AM] ✔ Nuxt Nitro server built in 1375ms [11:50:32 AM] ℹ Vite client warmed up in 2ms [11:50:33 AM] ℹ Vite server warmed up in 869ms`
Pull Request Link
No response
Reason for not contributing a PR
- [ ] Lack of time
- [x] Unsure how to implement the fix/feature
- [ ] Difficulty understanding the codebase
- [ ] Other
Other Reason
No response
Reproducer
https://stackblitz.com/edit/primevue-4-vite-issue-template-ho3kkhjn
Environment
Fails in a plain vanilla brand new nuxt project
Vue version
3.5.13
PrimeVue version
4.3.2
Node version
No response
Browser(s)
Any
Steps to reproduce the behavior
Create a brand new Nuxt project.
Follow steps to install TailwindCSS.
Follow steps to install latest (4.3.2) version of PrimeVue.
Run yarn run dev, error above happens.
Doesn't seem to happen under Vite in the Stackblitz example (is there a template for Nuxt?).
Expected behavior
Should launch under dev and work.
Same since updating to nuxt 3.16.0 not sure if it is related to this issue in nuxt
@jcham I also got this error. Solved it by installing the @primevue/forms lib too, npm install @primevue/forms
Temporary solution, but feels like the should add it as a dependency of primevue if it has to be used.
@jcham I also got this error. Solved it by installing the @primevue/forms lib too,
npm install @primevue/formsTemporary solution, but feels like the should add it as a dependency of primevue if it has to be used.
And if you didn't use its <Form /> or <FormField /> components, you can set excludes subproperty of the primevue property in the nuxt.config.ts.
I thought maybe I can yield a PR for this.
I have the same issue.
On my project I use Form, so I cannot exclude it. I would need to downgrade versions a bit. What's the last working version?
+1
+1
+1
+1
+1
+1, does this issue come with nuxt 3.16?
+1, does this issue come with nuxt 3.16?
I am on 3.15.4 and primevue is the same version as the op
+1 xD
+1 "primevue": "^4.0.3", "nuxt": "^3.12.2",
+1
"@primeuix/themes": "^1.0.0", "nuxt": "^3.16.0", "primevue": "^4.3.2", "devDependencies": { "@primevue/nuxt-module": "^4.3.2", }
+1
+1
I hope the problem gets fixed quickly, as I’m stuck relying on it. 😢
+1
+1
+1
+1
+1
+1
Any news about this?
I can't believe a huge breaking error is unresolved for a month, along with the FOUC issue that has been present since the release of v4, starting to think I'll be an ex-Primevue fan.
+1
I was facing the same issue, but I didn't use it. I solved it by installing @primevue/forms using npm install @primevue/forms.
[error] [ nuxi ] Nuxt Build Error: [31m[vite]: Rollup failed to resolve import "@primevue/forms/form?nuxt_component=async&nuxt_component_name=Form&nuxt_component_export=default" from
Is there any (even rough) ETA on this one? I see it's tagged for 4.3.4 but with no due date yet
This is bad, issue has been open for one month and is pretty critical since a lot of users experience it. Bad rep.
[error] [ nuxi ] Nuxt Build Error: [vite]: Rollup failed to resolve import "primevue/floatlabel?nuxt_component=async&nuxt_component_name=FloatLabel&nuxt_component_export=default" from "virtual:nuxt:%2Fopt%2Fbuildhome%2Frepo%2F.nuxt%2Fcomponents.plugin.mjs".
and the fix that worked for @nirjondipo does not work since floatlabel is not a package.
npm install @primevue/floatlabel
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@primevue%2ffloatlabel - Not found
npm ERR! 404
npm ERR! 404 '@primevue/floatlabel@*' is not in this registry.
*edit, excluded floatlabel since I'm not using it but now I get the same but for iconfield which I can't exclude since it's in use....