Closed marcobiedermann closed 5 years ago
@rosskevin can you check this one?
This is correct and works for both variations on esModuleInterop
, thank you @marcobiedermann. I wish there were tests in this project like i18next or react-i18next, but the original committer did not add any. They are welcome if you want to work on them.
@jamuhl please merge and release should be patch
@rosskevin
Unfortunately I do not see any way how to write tests for this by now since this project is written in vanilla JavaScript and I would not add a test written in TypeScript to be honest. If you really want to tests this, along with all other TypeScript definitions, I suggest to port this project over to TypeScript entirely.
Would be great if you guys could merge this bug and release a fix on npm. Currently I forked this project and included it into my main project
@marcobiedermann if you want to see how to write usage tests, check out how we do it in i18next https://github.com/i18next/i18next/blob/master/package.json#L84
@jamuhl doesn't want to use typescript directly. I do think it would be much simpler for all of this source to be in typescript, but it's jamuhl's prerogative and I respect that.
@rosskevin
Thank you very much for pointing out.
Yes a quick test would be to run the TypeScript compiler without outputting any code.
I did some quick testing and it seems like your TypeScript definitions do not match the current version of i18next
.
In general, all your dependencies are quite outdated.
I suggest to update all to the most recent version and add TypeScript checking afterwards. Otherwise you run into too many compatibility issues.
Please update at least the minimum necessary i18next version in the package.json. Feel free to use ncu and update all.
PS I'm neither maintainer or user of this package, just helping out. I help maintain i18next ts primarily.
published in i18next-express-middleware@1.8.2
Description
Fix TypeScript import of i18next in module declaration.
Since
i18next
does not provide a default export you have to import everything. Setting the TypeScript compile optionesModuleInterop
is not a good practise and not an option for most projects out there.Error stack