js-ceramic icon indicating copy to clipboard operation
js-ceramic copied to clipboard

JetLogger import in `@ceramicnetwork/common` is causing an error

Open ottodevs opened this issue 3 years ago • 2 comments

This import seems to be causing an error:

https://github.com/ceramicnetwork/js-ceramic/blob/7f458c878cc234fa226f9cb3d7ca2d2f5e4afc31/packages/common/src/loggers.ts#L1

Error:

import { LoggerModes, JetLogger as Logger } from 'jet-logger';
                      ^^^^^^^^^
SyntaxError: Named export 'JetLogger' not found. The requested module 'jet-logger' 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 'jet-logger';
const { LoggerModes, JetLogger: Logger } = pkg;

Following the advice and replacing the import seems to fix the error:

import pkg from 'jet-logger';
const { LoggerModes, JetLogger: Logger } = pkg;

ottodevs avatar Aug 19 '22 16:08 ottodevs

Adding more context:

The package jet-logger does not have any named export for JetLogger, that is probably causing the issue

ottodevs avatar Aug 19 '22 16:08 ottodevs

This was addressed here: https://github.com/ceramicnetwork/js-ceramic/pull/2384 A hotfix is incoming!

oed avatar Aug 19 '22 18:08 oed