Discord Bot using node Js

Please I’m getting this error can someone help me to fixe this error?

You’re mixing two module syntaxes. Once you use import it assumes it’s an ES module, so it’s telling you require needs to be replaced.

Use one or the other (probably require else you may get into a mess)

I included “type” : “module” to my package json I’m getting the same mistake.

nbif
Envoyé par Application Mail.ru pour iOS

You are mixing two module syntaxes in the same file.

If you tell Node that you’re using ESModules, ie you are using import, then what is require?

Again, if you don’t know what you’re doing re ESModules, I strongly suggest just using require and removing type: module. But if you want to use ESMmodules, then you need to use those, not try to use those and CJS modules at the same time

Thanks I’ve fixed the bug

nbif
Envoyé par Application Mail.ru pour iOS