When trying to load the library using and running the script in esm mode:
import { Client } from 'faye-websocket';
I got an error:
SyntaxError: Named export 'Client' not found. The requested module 'faye-websocket' 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 'faye-websocket';
const { Client } = pkg;
It suggests a workaround by using the default import first, then destruct the import, but it would be nice for the library to provide an esm entry point using the exports field.
When trying to load the library using and running the script in esm mode:
I got an error:
It suggests a workaround by using the default import first, then destruct the import, but it would be nice for the library to provide an esm entry point using the exports field.