Fork me on GitHub
#shadow-cljs
<
2022-11-08
>
Harel Lidar10:11:00

Hey, when trying to import a javascript library I get the following error: Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/harellidar/Documents/Work/product-and-marketing/delivery-page/node_modules/capture-website/index.js from /Users/harellidar/Documents/Work/product-and-marketing/delivery-page/dist/spiritt/delivery-page.cjs not supported. Instead change the require of index.js in /Users/harellidar/Documents/Work/product-and-marketing/delivery-page/dist/spiritt/delivery-page.cjs to a dynamic import() which is available in all CommonJS modules. Does anyone know how to solve this issue?

thheller10:11:00

sorry, on my way out. easy error to google. basically node cannot import ES module code from commonjs. you can maybe switch your build to use :target :esm, see docs.

Harel Lidar10:11:16

Tried changing target to esm and runtime to node and now im getting: The required JS dependency "node:process" is not available Any help with this?

thheller18:11:43

:js-options {:js-provider :import}

thheller10:11:05

back in a couple hours