Can't get working in Deno

I've been told Sapphire works in Deno, but when I tried to run my project as-is, I get this error.
No description
Solution:
I'm going to use this message to mark as resovled with @Answer Overflow. The TL;DR is that Deno's node modules compatibility is kind of garbage and the solutions are - Stick to NodeJS. @vladdy and I are of the opinion that OP's issues with Node can be solved with Node, it just requires some environment setup. - Use Bun instead of Deno, we fully support it and it does have proper support for node modules....
Jump to solution
138 Replies
RealShadowNova
RealShadowNovaā€¢9mo ago
Does it also run in Node.js?
Ruin šŸŒˆšŸ²
It works fine with Node I deleted my old node_modules and dist folders and now it works, but I do see "Warning: Not implemented: ClientRequest.options.createConnection" Should I be concerned about this? .....the bot also isn't responding to any commands.
ApplicationCommandRegistries: Took 0ms to initialize.
yeah, i think it's looking for javascript files and not properly accounting for typescript files?
Ruin šŸŒˆšŸ²
also this
No description
Favna
Favnaā€¢9mo ago
Are you loading TS files directly? I think we might need to add some code for that still but none of us have installed / used deno before to analyse what to add. Here specifically https://github.com/sapphiredev/pieces/blob/main/src/lib/strategies/LoaderStrategy.ts#L41-L44 For funsies you could try setting that env var mentioned there manually and see what happens But other than that if you can provide a repro sample then we can add proper deno support As for djs not exporting LocaleString, that would suggest you're using an outdated version of DiscordJS or Deno does something really weird and ecosystem incompatible with handling s package that re-exports from other packages. LocaleString is re-exported in discordjs from discord-api-types/v10
Ruin šŸŒˆšŸ²
If you have a package.json (which I do in this case), it uses the module versions in there.
Favna
Favnaā€¢9mo ago
Well is it the latest 14.14.1
Ruin šŸŒˆšŸ²
sorry i thought that was a statement, not a question. it's ~14.14.1 in package.json also, i tried setting TS_NODE_DEV. i'm pretty it did load the files, unlike before, since i got a bunch of import errors that i had to fix, but the commands still don't work and it still says it took 0ms to initialize.
Favna
Favnaā€¢8mo ago
bump because I want to look into this still
Favna
Favnaā€¢8mo ago
This is where I'm at now. @vladdy we should fix Deno support tbh. No idea yet why it picks up 1 command many times nor why it fails to load CoreReady.
vladdy
vladdyā€¢8mo ago
Ugh... Deno support will be hell compared to bun
Favna
Favnaā€¢8mo ago
GitHub
fix: add deno to the filters for loading TS files by favna Ā· Pull R...
This is at least one thing that's required, aside from any other issues that need to be fixed to add Deno support.
Favna
Favnaā€¢8mo ago
Did you get the same errors as me @Ruin šŸ² ?
vladdy
vladdyā€¢8mo ago
I wonder if the registry is somehow affected or if the piece is just loaded multiple times If you can get me a minimum repro I can take a look when I'm back And I've got some time Also does deno import esm or cjs of our module
Favna
Favnaā€¢8mo ago
ESM
vladdy
vladdyā€¢8mo ago
Phew But does it import esm or cjs of pieces When you import framework
Want results from more Discord servers?
Add your server