Fork me on GitHub
#nbb
<
2023-04-18
>
hifumi12306:04:38

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 😄

borkdude09:04:03

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

hifumi12306:04:09

Here’s a minimum reproducible project

hifumi12306:04:23

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

borkdude12:04:23

ok, I'll try

borkdude12:04:31

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

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

borkdude12:04:26

Perhaps file an issue on that project

hifumi12312:04:34

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