-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
primevue/nuxt-module: TypeScript support missing for auto-imported components when using components.prefix in PrimeVue Nuxt module #6499
Comments
I'm manually editing the module on my project |
It seems to me that this PR proposes the wrong logic. The point is that when autoImport is enabled, components should not be manually registered, right? autoImport should later, through "tree shaking," add only those components that are actually used, along with styles. Please review the This PR just allows for manual component registration even when autoImport is enabled... The issue here needs to be found in generating the types after tree shaking and determining the list of components that are being used, if I understand correctly. |
I'm talking about |
Ref: #6007 (comment) |
You're right, sorry EDIT: |
Could you please try your case after v4.1.0 is released? |
sure |
@mertsincan Sorry, I don’t quite understand, the latest available version on npm is 4.0.7. |
@mertsincan I also checked after v4.1.0 is released. The hints for component props are still not working. |
@mertsincan |
@vincenzomartusciello |
that's true |
@mertsincan Can you explain please what is going on with this
|
Describe the bug
Problem:
When using the
@primevue/nuxt-module
with the following configuration:autoImport: true
components.prefix
set to a custom value (e.g.,"Prime"
)The components are correctly auto-imported and work fine during build and runtime. However, in the development environment, TypeScript does not recognize these components. They are marked as unknown HTML tags, and there is no autocompletion or attribute hints provided.
If I either:
components.prefix
, orautoImport
and manually import components,Then everything works correctly, and TypeScript fully recognizes the components after restarting the dev server.
Expected Behavior:
TypeScript should recognize auto-imported components with a custom prefix and provide autocompletion and hints in the development environment.
Actual Behavior:
TypeScript does not recognize auto-imported components with a custom prefix, and they are marked as unknown HTML tags during development.
Environment:
Additional Context:
The problem seems to arise only when both
autoImport: true
and a customcomponents.prefix
are used together. Manually importing components or removing the prefix resolves the issue, but it's not ideal for larger projects that rely on auto-importing.Would appreciate any insights or potential fixes for TypeScript support with this setup. Thanks!
Reproducer
https://stackblitz.com/edit/primevue-nuxt-issue-template-si9bk9
PrimeVue version
4.0.7
Vue version
3.x
Language
TypeScript
Build / Runtime
Nuxt
Browser(s)
Chrome 90
Steps to reproduce the behavior
@primevue/nuxt-module
.Observe that:
<PrimeButton>
component. It is marked as an unknown HTML tag.Remove the
prefix
or disableautoImport
and restart the dev server to see TypeScript support restored.Expected behavior
No response
The text was updated successfully, but these errors were encountered: