i18next / i18next-http-backend

i18next-http-backend is a backend layer for i18next using in Node.js, in the browser and for Deno.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

npearson72 opened this issue Β· comments

πŸ› 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: i18next/i18next-resources-to-backend#5

Expected behavior

To not get this typescript error

Your Environment

  • runtime version: node 18
  • i18next version: 21.10.0
  • os: Mac

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

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