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 ™OP17mo ago
Oreo ™
Oreo ™OP17mo ago
And PrismaClient is getting imported properly And the other augments work fine
Oreo ™
Oreo ™OP17mo ago
Lioness100
Lioness10017mo 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
kyra17mo 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
Lioness10017mo 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 ™OP17mo ago
I tried that and it doesnt seem to work
Oreo ™
Oreo ™OP17mo ago
Gist
Augments.d.ts
GitHub Gist: instantly share code, notes, and snippets.
Oreo ™
Oreo ™OP17mo ago
heres my augments file
kyra
kyra17mo ago
It looks correct Then it may be due to duplicated @sapphire/pieces version, are you using npm or yarn?
Oreo ™
Oreo ™OP17mo ago
yarn v3 should i use npm?
kyra
kyra17mo ago
No, yarn
Solution
kyra
kyra17mo ago
Run yarn dedupe
Oreo ™
Oreo ™OP17mo ago
Worked
Want results from more Discord servers?
Add your server