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

API package not compiled? Missing: import { PrimeIcons } from "primevue/api"; #6117

Closed
cwdx opened this issue Jul 26, 2024 · 6 comments
Closed

Comments

@cwdx
Copy link

cwdx commented Jul 26, 2024

Describe the bug

[vite] Internal server error: Failed to resolve import "primevue/api" from "Component.vue". Does the file exist?

Reproducer

x

PrimeVue version

4.0.1

Vue version

4.x

Language

TypeScript

Build / Runtime

Vite

Browser(s)

Any

Steps to reproduce the behavior

No response

Expected behavior

In v3 we were able to import from import { PrimeIcons } from "primevue/api";
https://github.com/primefaces/primevue/blob/v3-prod/components/lib/api/PrimeIcons.js

In v4 the api doesn't seem to be compiled.
The source file doe exist in the master branch:
https://github.com/primefaces/primevue/blob/master/packages/core/src/api/Api.js
https://github.com/primefaces/primevue/blob/master/packages/core/src/api/PrimeIcons.js

Screenshot 2024-07-26 at 11 06 49

@cwdx cwdx added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jul 26, 2024
@matheusm
Copy link

I have the same issue! There are any advance?

@pulseczaralex
Copy link

Same issue

@tugcekucukoglu
Copy link
Member

@tugcekucukoglu tugcekucukoglu added Resolution: Needs Revision The pull request can't be merged. Conflicts need to be corrected or documentation and code updated. and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Aug 23, 2024
@cwdx
Copy link
Author

cwdx commented Aug 23, 2024

@tugcekucukoglu Yes the Api file looks correct, but I think it needs to be exported from the package.json

https://github.com/primefaces/primevue/blob/master/packages/primevue/package.json

You see, the export is missing there.

Screenshot 2024-08-23 at 11 55 04

@cantin-f
Copy link

cantin-f commented Aug 30, 2024

Still down in 4.0.5 :

import { FilterMatchMode, FilterOperator } from 'primevue/api';

Failed to resolve import "primevue/api" from "****.vue". Does the file exist?

EDIT v4 migration (https://primevue.org/guides/migration/v4/) :
image

And it works.

@mertsincan
Copy link
Member

Yep, please use from '@primevue/core/api' or from 'primevue'

@mertsincan mertsincan removed the Resolution: Needs Revision The pull request can't be merged. Conflicts need to be corrected or documentation and code updated. label Sep 4, 2024
@mertsincan mertsincan pinned this issue Sep 4, 2024
@mertsincan mertsincan unpinned this issue Nov 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants