i18next / i18next-http-backend

i18next-http-backend is a backend layer for i18next using in Node.js, in the browser and for Deno.
MIT License
447 stars 69 forks source link

Could not find a declaration file for module 'i18next-http-backend' #121

Closed npearson72 closed 1 year ago

npearson72 commented 1 year ago

πŸ› Bug Report

With typescript 5.0.2 and i18next-http-backend 1.4.4, running tcs produces the following error:

Could not find a declaration file for module 'i18next-http-backend'. '/Users/me/Dev/project/node_modules/i18next-http-backend/esm/index.js' implicitly has an 'any' type.
  There are types at '/Users/me/Dev/project/node_modules/i18next-http-backend/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'i18next-http-backend' library may need to update its package.json or typings.

3 import HttpApi from 'i18next-http-backend';
                      ~~~~~~~~~~~~~~~~~~~~~~

To Reproduce

I simply have this imported in my config file:

import HttpApi from 'i18next-http-backend';

I'm using these tsconfig.json compiler options:

    "moduleResolution": "bundler",
    "allowImportingTsExtensions": true,

And then I run tsc

There appears to be a similar reference here: https://github.com/i18next/i18next-resources-to-backend/issues/5

Expected behavior

To not get this typescript error

Your Environment

adrai commented 1 year ago

Have you tried with the newest i18next-http-backend version? v2.2.1

npearson72 commented 1 year ago

I could have sworn I tried the latest version, but apparently I didn't. It is working now. My appologies.