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

Explicit export of DesignToken type and $dt needed #5910

Closed
mcmimik opened this issue Jun 17, 2024 · 2 comments
Closed

Explicit export of DesignToken type and $dt needed #5910

mcmimik opened this issue Jun 17, 2024 · 2 comments
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@mcmimik
Copy link

mcmimik commented Jun 17, 2024

Describe the bug

We need to import types from ts-helpers, specifically the DesignToken type. Currently, it seems impossible to import this type from @primevue/core without encountering an error.

Error text:

[plugin:vite:import-analysis] Failed to resolve entry for package "@primevue/core". The package may have incorrect main/module/exports specified in its package.json: Missing "." specifier in "@primevue/core" package

[vue-tsc] Cannot find module '@primevue/core' or its corresponding type declarations.

Additionally, the $dt export from @primevue/themes is also missing.

[vue-tsc] Module '"@primevue/themes"' has no exported member '$dt'.

Could you please fix explicit exports for both the DesignToken type and $dt?

Reproducer

https://stackblitz.com/edit/primevue-4-0-0-rc2-vue-tsc?file=src%2FApp.vue

PrimeVue version

4.0.0-rc.2

Vue version

3.x

Language

TypeScript

Build / Runtime

TypeScript

Browser(s)

No response

Steps to reproduce the behavior

  1. import { DesignToken } from "@primevue/core";
  2. import { $dt } from "@primevue/themes";

Expected behavior

No response

@mcmimik mcmimik added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jun 17, 2024
@damoxc
Copy link

damoxc commented Jun 26, 2024

Modifying the package.json contained within the package with this allowed me to import HintedString from @primevue/core

--- node_modules/@primevue/core/package.json.bak	2024-06-26 08:45:07.504982786 +0100
+++ node_modules/@primevue/core/package.json	2024-06-26 08:45:09.738334855 +0100
@@ -16,6 +16,10 @@
   "main": "./index.mjs",
   "types": "./index.d.ts",
   "exports": {
+    ".": {
+      "types": "./index.d.ts",
+      "import": "./index.mjs"
+    },
     "./*": {
       "types": "./*/index.d.ts",
       "import": "./*/index.mjs"

@mertsincan
Copy link
Member

I think this issue has been fixed in rc.3. Please try it.

Best Regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Projects
None yet
Development

No branches or pull requests

3 participants