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 a fix for types resolution #179

Closed
Tonyp85-25 opened this issue Apr 11, 2024 · 1 comment · Fixed by #180
Closed

Add a fix for types resolution #179

Tonyp85-25 opened this issue Apr 11, 2024 · 1 comment · Fixed by #180
Assignees
Labels
bug Something isn't working

Comments

@Tonyp85-25
Copy link

There is a typescript error when importing this package :
import { IRR } from "@formulajs/formulajs";

error message : TS7016: Could not find a declaration file for module @formulajs/formulajs. /xxxx/node_modules/@formulajs/formulajs/lib/esm/index.mjs implicitly has an any type. There are types at /xxxx/node_modules/@formulajs/formulajs/types/index.d.ts , but this result could not be resolved when respecting package.json exports. The @formulajs/formulajs library may need to update its package.json or typings.

My tsconfig.json has the parameter moduleResolution set to bundler.

You can check with this tool
This happened with a lot of packages and according to this thread , the solution is a fix from the library author

@nicolashefti nicolashefti added the bug Something isn't working label Apr 15, 2024
nicolashefti pushed a commit that referenced this issue Apr 16, 2024
* Switch to flat config.  See eslint.config.js

* Eslint flat config file

* Support type definitions for dual exports.  Update dependencies.

* Update dependencies

* Generate separate definition files for .cjs and .mjs

* Add eslint globals

* Remove unused eslint rules

* Clear `types` folder before bundling

* Move `@eslint/js` to devDependencies
@nicolashefti
Copy link
Member

Thanks @bornova for the patch. @Tonyp85-25 should be fixed with release 4.4.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants