jazz-soft/JZZ

Usage for Typescript / ES6 Error

Opened this issue · 2 comments

I'm fairly new to working with packages and modules,
but I received an error in Node when using the Typescript / ES6 syntax
as shown in the Usage section of the README.

import { JZZ } from 'jzz';
         ^^^
SyntaxError: Named export 'JZZ' not found. The requested module 'jzz' is a CommonJS module, 
which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from 'jzz';
const { JZZ } = pkg;

    at ModuleJob._instantiate (node:internal/modules/esm/module_job:123:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:189:5)

Node.js v19.9.0

Hi! Thanks for asking!
Short answer - do as your compiler suggests.
Longer story - please let me know what is your full build setup.

For the error post above, I was experimenting with the different usages for JZZ.
After installing the package with npm,
I made a test.mjs file that I tried to run with nodejs.

import { JZZ } from 'jzz';
console.log(JZZ)

then command line

node test.mjs

Also, wanted to mention that JZZ and the other modules, tiny synth, karaoke, gui player
have been incredibly useful for my projects.
Thank you for making these available.