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 toastOP7mo ago
i'm assuming this is because i'm on an M1 chip?
UndiedGFX
UndiedGFX7mo ago
you have the required binaries for node-gyp installed?
i am toast
i am toastOP7mo ago
no but i'm using bun instead of node so that could also be the problem
UndiedGFX
UndiedGFX7mo 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
vladdy7mo ago
Hmmm
i am toast
i am toastOP7mo ago
I might just try and remove all the type references that seems like the easiest solution
UndiedGFX
UndiedGFX7mo ago
so is that a no for now?
vladdy
vladdy7mo ago
Idk, we haven't tested bun with it
UndiedGFX
UndiedGFX7mo ago
you were the one who gave greenlight for bun
vladdy
vladdy7mo ago
I never gave greenlight for bun nor said all of sapphire is compatible I said framework works with bun Which it does
UndiedGFX
UndiedGFX7mo ago
poor me expected you used the official examples repo to test it
i am toast
i am toastOP7mo 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
vladdy7mo 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
UndiedGFX7mo ago
meguFace dig deeper, you can do this vlad
vladdy
vladdy7mo ago
i am working, you can use google it doesnt bite
i am toast
i am toastOP7mo 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
vladdy7mo ago
.
UndiedGFX
UndiedGFX7mo 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
vladdy7mo 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 toastOP7mo ago
did you try what undied just suggested
vladdy
vladdy7mo ago
I installed it with bun and it installed the wrong prebuild version
i am toast
i am toastOP7mo ago
ok
UndiedGFX
UndiedGFX7mo ago
so the prebuild is there just the wrong one
vladdy
vladdy7mo ago
but for the wrong version which is weird
UndiedGFX
UndiedGFX7mo ago
exactly i was expecting bun to not at all install the prebuild
vladdy
vladdy7mo ago
AND it shouldn't matter cuz its building
Ruin 🌈🐲
Ruin 🌈🐲3mo ago
Hello. This seems to still be an issue.
No description
vladdy
vladdy3mo 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
Ruin 🌈🐲
Ruin 🌈🐲3mo ago
? i just used bun install and PM2 with interpreter set to "bun"
Want results from more Discord servers?
Add your server