nbb 2023-04-18

Trying to use ink-table but I am getting

require() of ES Module ... is not supported
despite importing via (require '["ink-table$default" :as Table]). Is it possible to use this library at all? In the end I was simply looking to align text in two columns and I remembered cljs.pprint/cl-format is a thing 😄

ok, I'll try

This appears to be a problem with that library. I can reproduce it with: foo.mjs:

import Table from "ink-table";
node foo.mjs

Perhaps file an issue on that project

Yeah, I notice some of these libraries have issues filed against them since they can’t be used easily, even in vanilla JS projects

I don't know why you were getting that message. nbb is able to load both ES6 modules and cjs

Here’s a minimum reproducible project

In the folder, run npm ci && nbb -m sample