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

PrimeOne Theme v4: Typescript error Could not find a declaration file for module 'primevue/themes/primeone' and aura theme #5521

Open
sceee opened this issue Apr 3, 2024 · 3 comments
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@sceee
Copy link

sceee commented Apr 3, 2024

Describe the bug

When using the PrimeOne theme with primevue 4.0.0-beta.1 and following the documentation here, I get several typescript errors:

error TS7016: Could not find a declaration file for module 'primevue/themes/primeone'. 'C:/....................../node_modules/primevue/themes/primeone/index.cjs.js' implicitly has an 'any' type.

35 import PrimeOne from 'primevue/themes/primeone'



error TS2306: File 'C:/......................../node_modules/primevue/themes/index.d.ts' is not a module.

1 import { definePreset } from 'primevue/themes'


error TS7016: Could not find a declaration file for module 'primevue/themes/primeone/aura'. 'C:/............................./node_modules/primevue/themes/primeone/aura/index.cjs.js' implicitly has an 'any' type.

2 import Aura from 'primevue/themes/primeone/aura'

Actually, node_modules\primevue\themes\index.d.ts is empty.
For node_modules\primevue\themes\primeone\index.cjs.js I am not sure if it is correct that the cjs.js is "used" as there is also an index.esm.js in the same folder which does not seem to be used.

Reproducer

https://stackblitz.com/edit/primevue-create-vue-typescript-issue-template-3mcqk5?file=src%2Fmain.ts

PrimeVue version

4.0.0-beta.1

Vue version

3.x

Language

TypeScript

Build / Runtime

Vite

Browser(s)

No response

Steps to reproduce the behavior

// Also see the linked Stackblitz repro - in main.ts the editor highlights line 3-5 with the reported errors.

  1. Create a vite project using the Theme configuration example here
  2. Execute npx tsc

Expected behavior

No typescript compile errors occur, types are correct.

@sceee sceee added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Apr 3, 2024
@sn0rcha
Copy link

sn0rcha commented Apr 24, 2024

+1 having the same issue.

When I go to build using Vite, I get the following notices:

Export "default" of module "node_modules/primevue/themes/config/index.esm.js" was reexported through module "node_modules/primevue/themes/index.esm.js" while both modules are dependencies of each other and will end up in different chunks by current Rollup settings. This scenario is not well supported at the moment as it will produce a circular dependency between chunks and will likely lead to broken execution order.

@sceee
Copy link
Author

sceee commented May 3, 2024

Note: It changed a bit with primevue v4.0.0-beta.2 since there is no longer the base theme but the other errors remain.

@mertsincan
Copy link
Member

Thanks a lot for your reports! I'll fix it for the next release.

@mertsincan mertsincan self-assigned this May 3, 2024
@mertsincan mertsincan added this to the 4.0.0-beta.3 milestone May 3, 2024
@mertsincan mertsincan added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels May 3, 2024
@mertsincan mertsincan modified the milestones: 4.0.0-beta.3, 4.0.0-rc.1 May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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

3 participants