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