Augmenting Container Failed

declare module '@sapphire/pieces' {
interface Container {
db: PrismaClient;
}
}
declare module '@sapphire/pieces' {
interface Container {
db: PrismaClient;
}
}
Idk why but this suddenly stopped working after i installed the following packages @sapphire/async-queue @sapphire/fetch @sapphire/pieces @sapphire/discord.js-utilities Everything was working fine before but i think after i installed @sapphire/pieces it broke. I tried reinstallig the node_modules and reloading vscode but nothing seems to work
Solution:
Run yarn dedupe
Jump to solution
14 Replies
Oreo ™
Oreo ™16mo ago
Oreo ™
Oreo ™16mo ago
And PrismaClient is getting imported properly And the other augments work fine
Oreo ™
Oreo ™16mo ago
Lioness100
Lioness10016mo ago
@oreotm. I think it's the best idea to not install @sapphire/pieces directly. It introduces conflicts such as what you're experiencing. Everything you'd need from pieces is reexported from /framework.
kyra
kyra16mo ago
You need to import '@sapphire/pieces'; at the top of the file, it's a requirement for augmenting, otherwise it's declarating which in turn replaces the types.
Lioness100
Lioness10016mo ago
I don't know if that would be the problem, because it worked before they added the new packages (not changing the file), right?
Oreo ™
Oreo ™16mo ago
I tried that and it doesnt seem to work
Oreo ™
Oreo ™16mo ago
Gist
Augments.d.ts
GitHub Gist: instantly share code, notes, and snippets.
Oreo ™
Oreo ™16mo ago
heres my augments file
kyra
kyra16mo ago
It looks correct Then it may be due to duplicated @sapphire/pieces version, are you using npm or yarn?
Oreo ™
Oreo ™16mo ago
yarn v3 should i use npm?
kyra
kyra16mo ago
No, yarn
Solution
kyra
kyra16mo ago
Run yarn dedupe
Oreo ™
Oreo ™16mo ago
Worked
Want results from more Discord servers?
Add your server