mirror of
https://github.com/stoatchat/javascript-client-sdk.git
synced 2026-07-20 20:16:06 -04:00
ERR_REQUIRE_ESM when using TypeScript #12
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ohxxm on GitHub (Feb 21, 2022).
`
Error [ERR_REQUIRE_ESM]: require() of ES Module /home//node_modules/revolt.js/dist/index.js from /home//Projects//src/util/client.js not supported.
Instead change the require of index.js in /home//Projects//src/util/client.js to a dynamic import() which is available in all CommonJS modules.
at Object. (/home//Projects//src/util/client.js:13:21)
at Object. (/home//Projects/*/src/index.js:3:18)
at async Promise.all (index 0) {
code: 'ERR_REQUIRE_ESM'
}
Node.js v17.5.0
`
When running with ts-node, this error is outputted.
@Rexogamer commented on GitHub (Mar 19, 2022):
This is an issue with your code. You need to use ESM - more details here.