Build Error with ts-node
Hi, I'm using typescript and I'm getting a strange error that isn't actually in my file!
The code in question:
https://srcb.in/HRuwOaDSwE
To load this file, i'm using the "import-sync" module.
9 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!
- ✅
Marked as resolved by staffI know, I only use it for developping.
Using
tsc
works fine. Only ts-node is having this error
Oh that exists?use deno if you want to write your bot in ts, it's easier + you don't have to configure any tsconfig.json, and there isn't any double storage thing with src/build folders
Sadly I’ve already coded my whole template with typescript in nodejs…
Will this auto refresh the files when saved?
it shouldn't be that hard to convert
you just install deno
i think
and then delete your tsconfig.json and the /build directory
then deno run index.ts in cmd
and u should be good to go
that's what i did
What are the other advantages of demo
idk just free ts
only downside is that intellisense is hella slow
@Qjuh I've been trying to follow your advice and run the compiled code instead of using ts-node.
But i can't manage to make it so my other non-ts files are added to the build
(images, config files, etc)
I never used the build because I never deployed to production. I was testing on my machine with ts-node
So like do I put my images, config, etc outside of src?
bruh just use a loader
node --no-warnings --loader ts-node/esm src/index.ts