#Getting and TypeError: (0 , status_1.SendStatusEmbed) is not a function
29 messages · Page 1 of 1 (latest)
a TypeError is a runtime error
if node says it's not a function, then it's either not a function, or there is something going on with your compiled code
thats very weird
its a function i can call it in the file where im exporting it
maybe showing more could would help
and a stacktrace too
also, are you using discord.js or something?
yeah. i do
channel.send({ embeds: [StatusEmbed]}).then((message:any) => {
const obj:object = {
"channelid": channelid,
"messageid": message.id,
"ip": ip,
"port": port
}
fs.writeFileSync(configPATH,JSON.stringify(obj))
})
}```
File where where its called:
```import { SendStatusEmbed, StatusEmbed} from "../../../commands/status";```
well, would be interesting to show that file as well, since you are using SendStatusEmbed
the funtion in the file is here
oh, right
other than that there is nothing elsse except the variables used to run the func
what about the stacktrace?
wdym?
the error message you got
it also had information about the exact place where the code crashed
it might give some clues
where does the error occur?
TypeError: (0 , status_1.SendStatusEmbed) is not a function
at C:\Users\dep\Desktop\GIT\Bot\src\events\ready\stat\status.ts:22:95
at processTicksAndRejections (node:internal/process/task_queues:95:5)
The error occurs when this line of code is "loading/awaitng" but fails and tries to run the .catch
Where is the function
maybe try having a look at the generated code 
also, what are you using to compile your code? just tsc? or some other tool?
ts-node for programming. When the project is done built by TSC to prod
maybe try build it locally with tsc, just to see what the emitted code looks like
because it should be a function and it should be callable 
lookin at the compiled code..
The status_1 is name of file from where the function is exported and when i ctrl+click it it takes me there
so weirrrdd