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

Add types to package.json exports #29

Merged
merged 1 commit into from
Jun 26, 2023
Merged

Add types to package.json exports #29

merged 1 commit into from
Jun 26, 2023

Conversation

bahlo
Copy link
Member

@bahlo bahlo commented Jun 26, 2023

Otherwise projects might complain, here's Vue:

src/App.vue:5:23 - error TS7016: Could not find a declaration file for module '@axiomhq/js'. '/Users/arne/[...]/node_modules/@axiomhq/js/dist/esm/index.js' implicitly has an 'any' type.
  There are types at '/Users/arne/[...]/node_modules/@axiomhq/js/dist/types/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@axiomhq/js' library may need to update its package.json or typings.

See also microsoft/TypeScript#46334

Closes #28

Otherwise projects might complain, here's Vue:

> src/App.vue:5:23 - error TS7016: Could not find a declaration file for module '@axiomhq/js'. '/Users/arne/Developer/axiomhq/axiom_ts_issue/node_modules/@axiomhq/js/dist/esm/index.js' implicitly has an 'any' type.
>   There are types at '/Users/arne/Developer/axiomhq/axiom_ts_issue/node_modules/@axiomhq/js/dist/types/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@axiomhq/js' library may need to update its package.json or typings.

See also microsoft/TypeScript#46334
@vercel
Copy link

vercel bot commented Jun 26, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
axiom-js 🛑 Canceled (Inspect) Jun 26, 2023 0:34am

Copy link
Contributor

@bdsqqq bdsqqq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah how I love package configs

Do we wanna add "module": "dist/esm/index.js" or "main": "dist/cjs/index.js" too? forgot what they do but found them while referencing another lib's package.json

@bahlo
Copy link
Member Author

bahlo commented Jun 26, 2023

@bdsqqq Let's wait until we need that ✌🏻

@bahlo bahlo merged commit 0affd42 into main Jun 26, 2023
@bahlo bahlo deleted the arne/fix-types branch June 26, 2023 12:45
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

Successfully merging this pull request may close these issues.

Cannot find Typescript declarations when building Vue 3 project
2 participants