-
-
Notifications
You must be signed in to change notification settings - Fork 260
Open
Description
First of all my entire codebase is in TS. I have an api which is in CJS. It imports a common
library in my Monorepo that is in originally in ESM. (type: module in package.json) but this is build with tsup in js files in esm and cjs. BUT the problem is that my Time.cjs file import another file (Random.js) in my common
lib and I think tsup don't correctly link this. It keeps the Random.js instead of Random.cjs. Or maybe am I missing something? Thanks in advance for the help.
Internal error occurred during message handling. Please check your implementation. Error [ERR_REQUIRE_ESM]: require() of ES Module /app/packages/common/dist/Random.js from /app/packages/common/dist/Time.cjs not supported.
Instead change the require of Random.js in /app/packages/common/dist/Time.cjs to a dynamic import() which is available in all CommonJS modules.
at Object.<anonymous> (/app/packages/common/dist/Time.cjs:1:88)
at /app/apps/api/dist/types/subscriptions/index.js:1:748
yovanoc and yunsiiAchaak and jokester
Metadata
Metadata
Assignees
Labels
No labels