Closed stevehanson closed 9 months ago
I tried this out, but then some of our dependencies, like Chalk, don’t work since they are pure ESM, which doesn’t work together with CJS. I deployed a beta thoughtbelt version 0.1.10 (BETA) with that change, but when I run it, I get this error:
/Users/shanson/dev/thoughtbelt/dist/index.cjs:919
var import_chalk = __toESM(require("chalk"), 1);
^
Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/shanson/dev/thoughtbelt/node_modules/chalk/source/index.js from /Users/shanson/dev/thoughtbelt/dist/index.cjs not supported.
Instead change the require of index.js in /Users/shanson/dev/thoughtbelt/dist/index.cjs to a dynamic import() which is available in all CommonJS modules.
at Object.<anonymous> (/Users/shanson/dev/thoughtbelt/dist/index.cjs:919:28) {
code: 'ERR_REQUIRE_ESM'
}
I don't have more time right now to dig into this. I’m guessing we never ran a thoughtbelt script in an existing project after setting up tsup compilation.
Was getting an error in existing Expo apps: