trouble importing @sapphire/type

Hi, I'm trying to make an eval command and I'm importing @sapphire/type. There are no errors in the code, but when I run my bot I'm getting this error:
Error when loading '/Users/gww/bot/src/commands/Owner/eval.ts': error: Cannot find module "/Users/gww/bot/node_modules/@sapphire/type/prebuild/type-node-v115-darwin-arm64-unknown-unknown/type.node" from "/Users/gww/bot/node_modules/@sapphire/type/dist/esm/index.mjs"
Error when loading '/Users/gww/bot/src/commands/Owner/eval.ts': error: Cannot find module "/Users/gww/bot/node_modules/@sapphire/type/prebuild/type-node-v115-darwin-arm64-unknown-unknown/type.node" from "/Users/gww/bot/node_modules/@sapphire/type/dist/esm/index.mjs"
29 Replies
i am toast
i am toastOP2y ago
i'm assuming this is because i'm on an M1 chip?
UndiedGFX
UndiedGFX2y ago
you have the required binaries for node-gyp installed?
i am toast
i am toastOP2y ago
no but i'm using bun instead of node so that could also be the problem
UndiedGFX
UndiedGFX2y ago
you need node-gyp for @sapphire/type to work if you wouldnt mind a pretty very not useful part in the eval command, remove all the @sapphire/type references @vladdy any workaround for node-gyp on bun?
vladdy
vladdy2y ago
Hmmm
i am toast
i am toastOP2y ago
I might just try and remove all the type references that seems like the easiest solution
UndiedGFX
UndiedGFX2y ago
so is that a no for now?
vladdy
vladdy2y ago
Idk, we haven't tested bun with it
UndiedGFX
UndiedGFX2y ago
you were the one who gave greenlight for bun
vladdy
vladdy2y ago
I never gave greenlight for bun nor said all of sapphire is compatible I said framework works with bun Which it does
UndiedGFX
UndiedGFX2y ago
poor me expected you used the official examples repo to test it
i am toast
i am toastOP2y ago
i'll prob just remove the type references for now but if i find a solution for bun i'll post it in here
vladdy
vladdy2y ago
Is the file present in the nodemodules folder tho Oh it could also be preinstall script related Which bun has a setting for in pkg json
UndiedGFX
UndiedGFX2y ago
meguFace dig deeper, you can do this vlad
vladdy
vladdy2y ago
i am working, you can use google it doesnt bite
i am toast
i am toastOP2y ago
i thought it might be this so i added @sapphire/type as a trused dependency in my package.json and re-installed all my packages but this didn't work
vladdy
vladdy2y ago
.
UndiedGFX
UndiedGFX2y ago
does bun even support node-gyp? @i am toast i have a workaround use node until @sapphire/type creates that file because it should have node-gyp and after that use bun if you didnt understand, install node-gyp and its required binaries, add @sapphire/type with yarn/npm/pnpm move back to bun
vladdy
vladdy2y ago
Cannot find module "/Users/vlad/Development/__temp/node_modules/@sapphire/type/prebuild/type-node-v115-darwin-arm64-unknown-unknown/type.node" from "/Users/vlad/Development/__temp/node_modules/@sapphire/type/dist/esm/index.mjs" oh interesting
i am toast
i am toastOP2y ago
did you try what undied just suggested
vladdy
vladdy2y ago
I installed it with bun and it installed the wrong prebuild version
i am toast
i am toastOP2y ago
ok
UndiedGFX
UndiedGFX2y ago
so the prebuild is there just the wrong one
vladdy
vladdy2y ago
but for the wrong version which is weird
UndiedGFX
UndiedGFX2y ago
exactly i was expecting bun to not at all install the prebuild
vladdy
vladdy2y ago
AND it shouldn't matter cuz its building
Fayne 🌈🐱
Fayne 🌈🐱14mo ago
Hello. This seems to still be an issue.
No description
vladdy
vladdy14mo ago
If this is a bun issue, please report it to them But it sounds like you have a discrepancy between what you use to install deps and what you use to run
Fayne 🌈🐱
Fayne 🌈🐱14mo ago
? i just used bun install and PM2 with interpreter set to "bun"

Did you find this page helpful?