ceramicnetwork / ceramicnetwork/js-ceramic
JetLogger import in `@ceramicnetwork/common` is causing an error
- Dominant language
- TypeScript
- Stars
- 423
- Forks
- 126
- PR merge metrics
- No merged PRs in 30d
Description
This import seems to be causing an error:
https://github.com/ceramicnetwork/js-ceramic/blob/7f458c878cc234fa226f9cb3d7ca2d2f5e4afc31/packages/common/src/loggers.ts#L1
Error:
```sh
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:
```js
import pkg from 'jet-logger';
const { LoggerModes, JetLogger: Logger } = pkg;
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at packages/common/src/loggers.ts line 1 and reproduce the reported import error when loading @ceramicnetwork/common. Compare the existing import with the CommonJS compatibility guidance in the issue, then run the relevant package checks. Done means the common package loads without the JetLogger named-export error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 42/100