komodojp / tinyld

Simple and Performant Language detection library for NodeJS

Home Page:https://komodojp.github.io/tinyld/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Types can't be found for tinyld/light

urlDev opened this issue · comments

Hey,

After comparing against multiple different packages/APIs, I decided to go with tinyld for my project, great work! However, when I wanted to import and use tinyld/light, I bumped into issues regarding type declarations.

Cannot find module 'tinyld/light' or its corresponding type declarations.

Looking at the package.json, I can see that you have declared type destination but seems like there is an issue about that regarding exports/paths.

Ok probably just some config issue in package.js, I will try to take a look at that later.
Just to check, do you use ESM or commonjs? and which version of NodeJS version are you using?

Meanwhile you can use tinyld, type should be working and api are the same

Indeed I found something off, some package.json fields like "main" and "exports" were apparently fighting each other.
I published a new version to fix this issue.

You can install it with: yarn add tinyld@1.3.4 or npm install tinyld@1.3.4
Can you give a try it and see if it solve your problem.

To double check, I also created a small sample project to reproduce the problem, and it seems to be working fine:

  • Tested with .js and commonJS
    image

  • Tested with .ts and ESM
    image

I installed and checked it in my local as well, and works as expected. Great job!