changed from npm to pnpm, bot doesn't work anymore

so I don't know what to supply to you other than a message. I have created a new folder, installed all the packages using pnpm that were necessary, pasted my src and then I ran npx tsc, when I run pnpm start or node ., doesnt matter, when I just turn on the bot using any method, it wont like respond, it is active, but does nothing. is there any particular reason for that?
Solution:
you didnt run pnpx prisma generate
Jump to solution
22 Replies
Shrewd 💫
Shrewd 💫OP•2w ago
just ask me any questions you want. I am generally interested in checking out pnpm and somehow I cannot get the bot to work and I posted it in the wrong section as well, apologies for that.
Sapphire
Sapphire•2w ago
When using pnpm you have to make sure that you have the shamefully-hoist and public-hoist-pattern are set correctly in your .npmrc file. This is because pnpm will not hoist any dependencies by default and that poses a problem with how Sapphire works with module augmentation and loading files from the filesystem. Add this to your .npmrc file:
shamefully-hoist=true
public-hoist-pattern[]=@sapphire/*
shamefully-hoist=true
public-hoist-pattern[]=@sapphire/*
Favna
Favna•2w ago
probably
Shrewd 💫
Shrewd 💫OP•2w ago
I got it as well I found about it yesterday and made sure to include it It's in root dir
Shrewd 💫
Shrewd 💫OP•2w ago
No description
Shrewd 💫
Shrewd 💫OP•2w ago
okay wait for a moment I think I messed it up
Favna
Favna•2w ago
if you also nuked node_modules between tries and you're 100% sure you changed nothing else then there should be no difference between the 2
Shrewd 💫
Shrewd 💫OP•2w ago
Nevermind, I thought that hoist-pattern had to be in its own line, comes out it was just my small screen cutting the text I can nuke it again and rerun pnpm i let's see - No, It did not fix anything. And for clarification, I installed pnpm using npm, if it changes anything.
Favna
Favna•2w ago
it shouldnt no
Shrewd 💫
Shrewd 💫OP•2w ago
funny thing is that somehow I did manage to do it on my uh, vps, it like did work, and the files are exactly the same here It did not work for the first time on there but then it did
Favna
Favna•2w ago
can you show your package.json?
Shrewd 💫
Shrewd 💫OP•2w ago
same timing, tell me; is there a chance it could all happen because I forgot to add module_alias in my package json? the thing to make my aliases in tsconfig work in dist folder module-alias or whatever it was called
Favna
Favna•2w ago
if you use the library, unnecessarily might I add, then yes unnecessary because it's build into Node if you configure it a bit differently
Shrewd 💫
Shrewd 💫OP•2w ago
okay I'll redo the folder in 10 minutes, need a little break. I'll let you know if it resolved anything
Favna
Favna•2w ago
anyway this is what is built into Node: https://nodejs.org/docs/latest/api/packages.html#subpath-imports Bots like @Dragonite, @Skyra , @Gemboard all use it so you can look at their code
Shrewd 💫
Shrewd 💫OP•2w ago
it is weird though because suddenly my code appeared to have errors @Boomeravna ? Didn't have them before
Favna
Favna•2w ago
I cant magically see your code so idk
Shrewd 💫
Shrewd 💫OP•2w ago
src/lib/prismaClient.ts:1:10 - error TS2305: Module '"@prisma/client"' has no exported member 'PrismaClient'.

1 import { PrismaClient } from '@prisma/client';
src/lib/prismaClient.ts:1:10 - error TS2305: Module '"@prisma/client"' has no exported member 'PrismaClient'.

1 import { PrismaClient } from '@prisma/client';
one example I'll get on the other ones immediately, just dont understand how they suddenly appeared as errors
Solution
Favna
Favna•2w ago
you didnt run pnpx prisma generate
Shrewd 💫
Shrewd 💫OP•2w ago
of course, I forgot about it. But why do we have to do it each time, I do technically have all the files of prisma in the folder and yes, all errors disappeared
Favna
Favna•2w ago
you deleted node_modules it generates to node_modules/.prisma
Shrewd 💫
Shrewd 💫OP•2w ago
o, it said it overwrited commands, which means it must work there we go, it works. thank you soooo much @Boomeravna
Want results from more Discord servers?
Add your server