framework7io / framework7

Full featured HTML framework for building iOS & Android apps
http://framework7.io
MIT License
17.98k stars 3.24k forks source link

There are types at `node_modules/framework7/framework7.d.ts` but this cannot be resolved when respecting package.json "exports" #4181

Closed arnu515 closed 5 months ago

arnu515 commented 1 year ago

Describe the bug

Framework7 (core module) typings do not work when used in a typescript file. They do however work when used in javascript.

To Reproduce

Steps to reproduce the behavior:

  1. Create a new vite project using npm init vite. Select React with Typescript.
  2. Install framework7 and framework7-react with NPM
  3. Import framework7/lite in src/main.tsx. The error should be visible. The framework7 library will not be typed
  4. Rename src/main.tsx to src/main.jsx. The error is now gone, and the library is properly typed.

Expected behavior

The library should be typed and the error should not be there

Actual Behavior

There is an error while importing the types.

Screenshots

The error in typescript file: image

Renaming to js file fixes the issue: image

Additional context

None