EthanStandel / deepsignal

113 stars 5 forks source link

Type definitions broken #16

Closed doinkythederp closed 10 months ago

doinkythederp commented 1 year ago

TypeScript cannot load this library's type definitions, with the following error:

Could not find a declaration file for module '@deepsignal/preact'. '[...]/@deepsignal/preact/dist/lib.es.js' implicitly has an 'any' type.
  There are types at '[...]/@deepsignal/preact/dist/lib.d.ts', but this result could not be resolved when respecting package.json "exports". The '@deepsignal/preact' library may need to update its package.json or typings.
EthanStandel commented 10 months ago

Sorry to be so late back to this @doinkythederp. I used TypeScript's recommendation preference on how to expose types, not via "exports" but via just a "type" property directly.

https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html

I'd ask you more information about your environment, but @patricklizon actually already opened a PR for the issue and linked the Webpack docs describing this preference.

https://webpack.js.org/guides/package-exports/

EthanStandel commented 10 months ago

New version released, closing out. Feel free to reopen if you're still having problems.