vlitejs / vlite

🦋 vLitejs is a fast and lightweight Javascript library for customizing video and audio player in Javascript with a minimalist theme (HTML5, Youtube, Vimeo, Dailymotion)
https://vlite.js.org
MIT License
266 stars 18 forks source link

ERROR: "Could not find a declaration file for module 'vlitejs'" in React/Typescript #85

Closed prodbyola closed 1 year ago

prodbyola commented 1 year ago

Describe the bug

After installing the library from npm, I tried importing it in my tsx file: import Vlitejs from 'vlitejs';

But the import gives an error: "Could not find a declaration file for module 'vlitejs'" and my program would not compile. I tried installing "@types/vlitejs" but it's not found on npm.

Steps to reproduce

  1. Import the vlitejs in tsx file.
  2. It gives an error that declaration file is not found and program would not compile.
  3. Tried installing "@types/vlitejs" but could not be found.

Expected behavior

Succesfully import and initialize Vlite.js in React/Typescript

Screenshots and recordings

No response

Vlite.js

4.2.0

Browser

Chrome 105.0.5195.127 (Official Build) (64-bit)

OS

Windows 11

Additional context

No response

yoriiis commented 1 year ago

Hello @prodbyola, there are 2 errors imo, the first "'Vlitejs' is declared but its value is never read" explains that you have imported the library but there is no use of the variable (initialization etc).

The second is related to TypeScript declaration files, not currently available, but can be ignored in the configuration

prodbyola commented 1 year ago

Thanks @yoriiis, I think it's truly related to Typescript declaration files. I'm not sure I want to ignore it in configuration though. Thanks for the heads up.

yoriiis commented 1 year ago

Okay so I'm closing this one because it's already been discussed in #50