#JS importing?

20 messages · Page 1 of 1 (latest)

ripe wraith
#

Is this a correct thing to import classes? because whenever i do this it returns error but if i delete it theres no issue at all?

#

this si how its exported

#

please help

strange flax
#

Excuse me,Could you tell me what do you want?

ripe wraith
tough night
#

!!help.img

languid mossBOT
#
⚠️ Please do not screenshot code as it causes a number of issues:
💠💠💠
  1. Ease of assistance - If someone wants to copy your code and correct it, they cannot. Making it easy for people to help you is in your best interests.
  2. Editorialising - It's common to try to make images small in size, which means you're likely to crop out code relevant to your issue.
  3. Accessibility - Wide images can be hard to read on mobile devices, and are impossible for screen readers.
  4. Legibility - You cannot read screenshots of code directly, instead you have to open them in an enlarged context.
  5. Bandwidth usage/clutter - Some of our members use metered connections, and it is wasteful for them to download images of text.

For a small amount of code, please use a codeblock (!!help.codeblocks), while an external repository (see !!help.code) is suitable for larger codebases.

modest jasper
#

Hello

twilit flame
#

what's the error?

ripe wraith
#
let BayesianAlgo;

    try {
      BayesianAlgo = require("../../client/Algorithms/BayesianAlgo");
  } catch (error) {
      console.error(`Error loading BayesianAlgo:`, error);
  }```
#

Please correct me if im wrong

buoyant sparrow
#

?
"... because whenever i do this it returns error..."

ripe wraith
#

I said

I think this will fix the code

#

and it did fix ://

buoyant sparrow
#

A try catch doesn't fix not working code it only catches the error

ripe wraith