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

Using TypeScript moduleResolution NodeNext throws errors #109

Open
efoken opened this issue Aug 14, 2023 · 1 comment
Open

Using TypeScript moduleResolution NodeNext throws errors #109

efoken opened this issue Aug 14, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@efoken
Copy link
Contributor

efoken commented Aug 14, 2023

Describe the bug

Just an example error:

packages/html/src/hooks/useAria.ts:3:25 - error TS7016: Could not find a declaration file for module 'atomico/core'. '/Users/eike.foken/Code/barmer-puls/node_modules/atomico/src/core.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/atomico` if it exists or add a new declaration (.d.ts) file containing `declare module 'atomico/core';`
3 import { useMemo } from 'atomico/core';

To Reproduce

  1. Add to tsconfig.json
{
  "compilerOptions": {
    "moduleResolution": "nodenext"
  }
}
  1. Import something, for example import { useMemo } from 'atomico/core'
  2. Get TypeScript errors

Solution

The exports field in package.json has to be updated to contain types

@UpperCod
Copy link
Member

Hi @efoken , I have added support for this type of configuration in the new version of atomico@1.73.0, along with new enhancements such as:

  • Custom types.
  • Support for tsconfig with moduleResolution set to nodeNext.
  • New hook, useAbortController.
  • New function for value configuration for props, now the value will always be the default.
  • Improved inference of props, assigning value to its configuration makes them no longer optional.

I hope all of this proves useful to you. You can learn about these changes in the release notes.

https://github.com/atomicojs/atomico/releases/tag/1.73.0

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

No branches or pull requests

2 participants