In a Remix 2 application where the root package.jsontype is set to module I am facing the following error when importing TwicImg:
import { TwicImg } from '@twicpics/components/react';
TS7016: Could not find a declaration file for module '@twicpics/components/react'.
'********************/node_modules/@twicpics/components/react/module.mjs' implicitly has an 'any' type.
There are types at ''********************/node_modules/@twicpics/components/react/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@twicpics/components' library may need to update its package.json or typings.
After doing some investigation it seems there is a missing exported type definition in @twicpics/components/package.json.
In 0.22.3 the exports part looks like this:
In a Remix 2 application where the root
package.json
type
is set tomodule
I am facing the following error when importingTwicImg
:After doing some investigation it seems there is a missing exported type definition in
@twicpics/components/package.json
. In0.22.3
theexports
part looks like this:Adding that missing
types
entry like it is added forsvelte4
toreact
seems to solve the typing issue:Could you please fix the package.json generation so that the missing
.d.ts
references are exported as well?