Error [ERR_REQUIRE_ESM]: require() of ES Module
Opened this issue · 0 comments
Gradlon commented
Superjson repo updated the codebase recently and changed.
The error was,
api:start:dev: const superjson = require('superjson');
api:start:dev: ^
api:start:dev: Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/gradlon/Desktop/fad-stack/node_modules/superjson/dist/index.js from /Users/gradlon/Desktop/fad-stack/node_modules/@soundxyz/redis-pubsub/dist/index.js not supported.
api:start:dev: Instead change the require of /Users/gradlon/Desktop/fad-stack/node_modules/superjson/dist/index.js in /Users/gradlon/Desktop/fad-stack/node_modules/@soundxyz/redis-pubsub/dist/index.js to a dynamic import() which is available in all CommonJS modules.