Closed fernandocanizo closed 1 year ago
Sorry, I misread the error on my editor since it doesn't output the whole error I pasted on the report but just this:
Property 'reportNamespaces' is missing in type 'import("./node_modules/i18next/index").i18n' but required in type 'import("./node_modules/i18next/index").i18n'.
which got me totally puzzled.
I realized this and went upstream to find the issue Type error with i18next@23.7.2+ where @adrai provides a possible solution. [haven't tried it yet]
ok, the solution is to leave the "moduleResolution": "Bundler",
in tsconfig.json
(don't change it, as initially suggested in referred issue from react-i18next
, to "NodeNext") and force the type on the i18n instance like this: (entry.server.tsx
)
import type { i18n as i18nType } from 'i18next';
// ...
const i18nInstance = createInstance() as i18nType;
I guess this was the path @stevensacks followed on issue 163 and that's why he closed it. I hope the next one stomping on this one doesn't loose an hour hunting the solution ;)
@fernandocanizo Ha, thank you so much! š
Describe the bug
Setting up
remix-i18next
, by following instructions verbatim from README leavesentry.server.tsx
with a Typescript error:This was already reported on issue #163 which was closed without further comments, so I'm reporting it on a new issue to differentiate the case (op on previous issue claims got the error on an update and I'm getting it starting from scratch).
entry.server.tsx
is a copy&paste from README.Your Example Website or App
https://github.com/fernandocanizo/learning-remix-with-i18n
Steps to Reproduce the Bug or Issue
pnpx create-remix check-issue
app/entry.{server,client}.tsx
with the code provided in README file.npm run typecheck
This steps only focus on the reported error and doesn't deal with other issues found with current sample setup and status of the library.
Expected behavior
Expected behavior is to have
npm run typecheck
run without errors and not have to hunt down Typescript errors from an example code.Screenshots or Videos
No response
Platform
Additional context
No response