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

@builder.io/sdk-vue is not properly reporting type declarations in package.json, causing type errors #3072

Open
Joepocalyptic opened this issue Mar 22, 2024 · 2 comments
Assignees

Comments

@Joepocalyptic
Copy link

Describe the bug

@builder.io/sdk-vue is not properly reporting its type declarations in the output package.json. The .d.cts files exist, but they appear to not be configured in the exports object. This causes a TS7016 error as shown below:

TS7016: Could not find a declaration file for module @builder.io/sdk-vue.
.../node_modules/.pnpm/@builder.io+sdk-vue@1.0.15_vue@3.4.21/node_modules/@builder.io/sdk-vue/lib/browser/index.js
implicitly has an any type.
There are types at .../node_modules/@builder.io/sdk-vue/lib/node/index.d.cts, but this result could not be resolved when respecting package.json exports. The @builder.io/sdk-vue library may need to update its package.json or typings.

According to:

"browser": {
"import": "./lib/browser/index.js",
"require": "./lib/browser/index.cjs"
},

It might be possible to fix this by adding a types key to each export referencing the .d.cts file.

To Reproduce

Steps to reproduce the behavior:

  1. Use @builder.io/sdk-vue in an environment with a type checker (such as vue-tsc)
  2. Attempt to reference an export from @builder-io/sdk-vue.
  3. Run the type checker if it was not done automatically during dev/build.

Expected behavior

Type checking and TypeScript IDE features function properly.

Screenshots

image
image

@mrkoreye
Copy link
Collaborator

@Joepocalyptic thanks for the detailed report!

@samijaber can you take a look please?

@mrkoreye mrkoreye removed their assignment Mar 22, 2024
@Joepocalyptic
Copy link
Author

Hi! Just wondering if there was any progress on this?

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

3 participants