-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Form: breaking autoImport: true
#6914
Comments
I haven't test it, but for Chart and Editor additional packages are required. The same goes for the newly added PrimeVue Forms library, which should be installed separately. Chart and Editor are excluded in module.ts and therefor not registered as global components on the Vue instance, but Form and FormField aren't. I think the PrimeVue Forms library should register the Form and FormField components as global components on the Vue instance, and should be excluded when PrimeVue is register components as global.
|
Adding the components Apparently components from Later on all components are registered, including the
|
And as a byproduct (which is already mentioned in this issue, yet should not be ignored), using Either way it should be merged with Nuxt (in this case). |
Describe the bug
When updating my dependencies I encountered this issue. The
components.d.ts
which is generated when runningnuxi dev
is located in the root of the folder. Since this folder is being used as a development environment I deem it unwise to have this file being rendered here.I expect the file to be generated in the
.nuxt
folder or merged with the nuxtcomponents.d.ts
.When going through the project I encountered this line being commented out:
nuxt.options.build.transpile.push('nuxt');
although I am not 100% sure if this is actually the reason why it is begin generated in the root.Along the commented line I found out that when you set up your
nuxt.config.ts
like this:(and using the new Form component which is automaticall included in v4.2.0), it results in a 500 error on the local development:
The issue
I expect that this is because
Form
is automatically included whilst it is not installed by me and, unlikeEditor
andChart
(which have to be installed by the developer manually), is not exlcluded. (see this line)You would have to manually exclude
Form
andFormField
to bypass this error like:Now I get that this setup is not the most ideal setup, yet I came across this because when you want the
components.d.ts
being generated and merged in the.nuxt/components.d.ts
, you need this setup. This way all PrimeVue components will be included in the.nuxt/components.d.ts
and is not the way to go when you set up a small project and want to only use components that you actually use. Yet, it is a bug nonetheless.Temporary solution
For the time being I extended my
.gitignore
containing thecomponents.d.ts
-line since it is automatically generated anyways and to keep my project clean. But I expect thecomponents.d.ts
, with this setup (as mentioned in "Expected outcome"), is merged in the.nuxt/components.d.ts
Reproducer
https://stackblitz.com/edit/nuxt-starter-x4svaa?file=nuxt.config.ts
PrimeVue version
4.2.0
Vue version
3.x
Language
TypeScript
Build / Runtime
Nuxt
Browser(s)
No response
Steps to reproduce the behavior
Prerequisites:
Rep. 1. For a solution where
components.d.ts
is merged with.nuxt/components.d.ts
nuxt.config.ts
like so:You will see an error like:
[nitro 9:38:03 AM] ERROR Error: Could not load /home/projects/nuxt-starter-x4svaa/node_modules/primevue/form/style/index.mjs (imported by virtual:#primevue-style): ENOENT: no such file or directory, open '/home/projects/nuxt-starter-x4svaa/node_modules/primevue/form/style/index.mjs'
Form
andFormField
in the excluded components:Rep. 2. For a solution where
components.d.ts
generated in the rootnuxt.config.ts
like so:components.d.ts
to your.gitignore
Reproduction 1 has the undesired setup of
nuxt.config.ts
and undesired outcome of all components being included in the project, but does merge the.nuxt/components.d.ts
with all PrimeVue components.Reproduction 2 has the undesired outcome of
components.d.ts
being generated in the root of you project but has the desired setup ofnuxt.config.ts
.Expected behavior
nuxt.config.ts
:And the contents of the root
components.d.ts
is merged with.nuxt/components.d.ts
.The text was updated successfully, but these errors were encountered: