Did the latest @sapphire/[email protected] update break things?
Super preliminary stuff because I haven't bothered to debug it thoroughly;
It seems like the plugin doesn't import in my logs after running
pnpm update
. The typings for the i18n entry in SapphireClient also disappeared. Reverting to 5.0.4 seems to fix the issue. Has anyone else encountered this?17 Replies
The only change is what is mentioned in #Announcements but make sure you're not yet on i18next v23
I did install i18next (latest, so v23) because I didn't know what I was doing. promptly uninstalled it when I realized I should be going through the plugin to interact with i18next. wonder if that's causing really weird problems, maybe because of pnpm?
deleting node_modules, and installing via npm doesn't seem to have worked (according to tsc)
also can't find any references to i18next@23 in pnpm-lock.yaml nor the package-lock.json file that was just created
you do need to install i18next but v22
oh huh
installing it separately seems to work! the TypeScript complier still seems to complain however about i18n being an unknown key in ClientOptions, though
make sure you call the
/register
somewhere in your codeimport '@sapphire/plugin-i18next/register'
i presume qualifies, in my setup.ts?
which setup.ts gets imported as the first line in my index.ts
throwing random thoughts because I seem to see the replies super duper late; I'm also using ESM, not sure if that matters here
I still have typings for other plugins (although I haven't really tested if they even work at all, like i18next) like the API and I believe unofficial Sentry pluginwhat's your TS version? and are you using @sapphire/ts-config?
I think you may have the same issue as https://github.com/sapphiredev/plugins/pull/471 but as I said there too, I cannot reproduce the issue.
GitHub
fix(i18next): Fix augments by Swiizyy · Pull Request #471 · sapphir...
Repair of module de Declarations that do not work after the last update.
check, but I thought I had them too, but in the end I had no resolutions for the modules I updated, so I switched to the 'Node16' resolution module, which allowed me to find everything again.
which is a TS 5.2 issue and will be fixed with @sapphire/ts-config v5 which I linked on your PR
oop, yeah im using TS 5.2. Currently using my own (ish) ts-config, think it had to do with trying to make TypeScript work with ESM
maybe also personal preference and/or debugging trying to figure out how to copy over my localization files from src/ into dist/ (ended up using a custom script, not sure how else rn). I think it was also why i18next (i think even with the 5.0.4 version) with HMR working sporatically? (i dont think it works anymore, either so maybe fixing this helps)
the sporatic behavior also be my custom script not copying files correctly though, but prolly doesn't explain it not working at all now
Set module and moduleResolution to node16.
moduleResolution Node is also called Node10, NodeJS 10 compatible. Not ESM.
Add
src/**/*.json
to your includes. And add the resolveJsonModules compiler optionat least for plugin-i18next, this seems to have worked! It also seems to have broken the hack I forgot I used to get typings for SentryOptions in '@kaname-png/plugin-sentry'
it looked somewhat like this:
For kaname's plugins you'll need him: @sawa_ko. The idea with community plugins is that you'll have to ask the creator for support.
But looking at that I'd say Kaname needs to fix his export mapping
seems to not have done anything, which puzzles me. just to double check, this would be correct?
oh wait a sec
nvm, it did work! probably forgot to rerun with
"resolveJsonModule": true
i believe
also fyi; i can't seem to mark this as the answer, as the Apps context menu isn't there. is that intended if I don't want to have the posts on answer overflow?discord client bug
because there is supposed to be many options