Skip to content
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

Forms: Incorrect main/module/exports error when importing #6709

Closed
jsodeman opened this issue Nov 1, 2024 · 8 comments
Closed

Forms: Incorrect main/module/exports error when importing #6709

jsodeman opened this issue Nov 1, 2024 · 8 comments
Assignees
Labels
Package: Forms name: @primevue/forms Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@jsodeman
Copy link

jsodeman commented Nov 1, 2024

Describe the bug

Vite reports an error when trying to find the @primevue/forms package.

The Vite error is "[vite] Internal server error: Failed to resolve entry for package "@primevue/forms". The package may have incorrect main/module/exports specified in its package.json."

My own package.json has type="module" listed.

Maybe one of the errors listed in this linter is causing the problem: https://publint.dev/@primevue/[email protected]

Reproducer

https://stackblitz.com/edit/primevue-4-vite-issue-template-v4gdpp?file=src%2FApp.vue

PrimeVue version

4.2.0

Vue version

4.x

Language

ES6

Build / Runtime

Vite

Browser(s)

No response

Steps to reproduce the behavior

Add @primevue/forms to a project. Import from the library.

Expected behavior

No response

@jsodeman jsodeman added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Nov 1, 2024
@Seaony
Copy link

Seaony commented Nov 1, 2024

same here

@mertsincan mertsincan self-assigned this Nov 1, 2024
@mertsincan mertsincan added Status: Pending Review Issue or pull request is being reviewed by Core Team and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Nov 1, 2024
@mertsincan mertsincan added this to the 4.2.1 milestone Nov 1, 2024
@mertsincan
Copy link
Member

Thanks a lot for your report! I'll check and get back to you.

@Zyles
Copy link

Zyles commented Nov 1, 2024

Wanted to try out this new form stuff and got hit with this massive blocker.

@mertsincan mertsincan added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Pending Review Issue or pull request is being reviewed by Core Team labels Nov 1, 2024
@mertsincan mertsincan added the Package: Forms name: @primevue/forms label Nov 1, 2024
@mertsincan
Copy link
Member

PrimeVue 4.2.1 Released 🚀 Please try it.

@jsodeman
Copy link
Author

jsodeman commented Nov 1, 2024

That fixed it, thank you for the quick release.

@jsodeman
Copy link
Author

jsodeman commented Nov 1, 2024

I getting a similar error for the yup resolver:

"[plugin:vite:import-analysis] Failed to resolve import "@primevue/forms/resolvers" from "". Does the file exist?"

@jsodeman
Copy link
Author

jsodeman commented Nov 1, 2024

@mertsincan Importing the yupResolver by pointing to the yup sub-folder works, though the IDE shows an error

image

So it looks like the resolver isn't being passed up to the top level exports from the resolvers library.

@mertsincan
Copy link
Member

Thanks a lot for your update! Could you please create a new ticket for it? Feel free to share any more feedback, I'd really love to hear that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: Forms name: @primevue/forms Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

4 participants