#why does this not work in sapphire

1 messages · Page 1 of 1 (latest)

ruby furnace
#

index.js

const { util } = require("./utils");
const { container } = require("@sapphire/framework");

container.util = util;

basically I want to access ./utils using this.container.util

torn galleonBOT
#

@ruby furnace to help others find answers, you can mark your question as solved via Right Click Solution Message->Apps->✅ Mark Solution

hard beaconBOT
#

When asking for help, make sure to provide as much detail as possible. What have you tried so far? Do you have stacktraces that you can show us? What are you trying to achieve? Try to answer these questions and others, so we do not have to ask for them afterwards.

❯ For a good guide on how to ask questions, see the instructions that StackOverflow gives. You should try to always follow these guidelines.
❯ For an excellent video that shows how not to ask technical questions is this, watch this YouTube video by LiveOverflow.
Asking technical questions (Clarkson)
How to ask questions the smart way (Raymond)

wild rock
#

Specifically, what problem are you running into? @ruby furnace

ruby furnace
wild rock
#

what, where, when

ruby furnace
#

evaled it using my eval cmd

wild rock
#

Can you show your full index.js?

ruby furnace
wild rock
#

Can you show utils.js please? 🙂

ruby furnace
wild rock
#

It looks like you're not exporting anything called util

#

Did you mean to use a default import?

#

That would be:

const util = require("./utils");
#

(removal of curly brackets)

ruby furnace
#

didn't notice that, thanks

torn galleonBOT
#

Thank you for marking this question as solved!

Question Message ID

1077373267888832542

Solution Message ID

1077388530864640020