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:
29 Replies
i'm assuming this is because i'm on an M1 chip?
you have the required binaries for node-gyp installed?
no but i'm using bun instead of node
so that could also be the problem
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?
Hmmm
I might just try and remove all the type references that seems like the easiest solution
so is that a no for now?
Idk, we haven't tested bun with it
you were the one who gave greenlight for bun
I never gave greenlight for bun nor said all of sapphire is compatible
I said framework works with bun
Which it does
poor me expected you used the official examples repo to test it
i'll prob just remove the type references for now but if i find a solution for bun i'll post it in here
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
i am working, you can use google
it doesnt bite
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
.
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
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
interestingdid you try what undied just suggested
I installed it with bun and it installed the wrong prebuild version
ok
so the prebuild is there
just the wrong one
but for the wrong version
which is
weird
exactly
i was expecting bun to not at all install the prebuild
AND
it shouldn't matter cuz its building
Hello. This seems to still be an issue.
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
? i just used
bun install
and PM2 with interpreter
set to "bun"