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

ts(7016) error: The library may need to update its package.json or typings #15

Open
ronaldtveen opened this issue Jul 24, 2023 · 1 comment

Comments

@ronaldtveen
Copy link

ronaldtveen commented Jul 24, 2023

I've been trying to get Momentum Trail working but I keep getting the follow error:

Could not find a declaration file for module 'momentum-trail'. '[..]/node_modules/momentum-trail/dist/momentum-trail.js' implicitly has an 'any' type. There are types at '[..]/node_modules/momentum-trail/dist/types/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'momentum-trail' library may need to update its package.json or typings.ts(7016)

While looking for a fix I see a couple of packages with this problem. I temporarily fixed it by adding a types/momentum-trail.d.ts with declare module 'momentum-trail'; as its content.
Problem with this is that it works locally, but when deploying it will error out.
A fix for that I read is to set the following in my jsconfig.json but that looks like a very nasty workaround that could have some other implications.

"compilerOptions": {
  "noImplicitAny": false
}

Can you fix this problem on your end, or at least document how to best go about this on the frontend for Vue 3 in the docs?

@studnitz
Copy link
Contributor

studnitz commented Aug 7, 2023

Opened a PR to fix this: lepikhinb/momentum-trail-helper#3

Meanwhile, if you use pnpm, you can use pnpm patch momentum-trail to patch the package yourself until the PR gets merged.

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

2 participants