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
452 stars 70 forks source link

Module '"i18next-http-backend"' has no exported member 'RequestCallback'. #125

Closed kpawelczak closed 1 year ago

kpawelczak commented 1 year ago

🐛 Bug Report

In my Angular project I use custom request - https://github.com/i18next/i18next-http-backend?tab=readme-ov-file#backend-options. After updating to version 2.4.1, I get an error that the type RequestCallback is not exported.

Module '"i18next-http-backend"' has no exported member 'RequestCallback'.

If I change the import to "i18next-http-backend/cjs"it does not complain and it works. Would be nice if we could get access to this type from esm module.

To Reproduce

import type {
  HttpBackendOptions,
  RequestCallback,
} from 'i18next-http-backend';

const request = (
      options: HttpBackendOptions,
      url: string,
      payload: string | object,
      callback: RequestCallback
    ) => {
    }

Expected behavior

RequestCallback can be imported from i18next-http-backend

Your Environment

adrai commented 1 year ago

Try with v2.4.2

kpawelczak commented 1 year ago

thanks, it works now. Really appreciate the fast response.