Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Named export 'Axiom' not found. The requested module '@axiomhq/js' is a CommonJS module #72

Closed
yaronlevi opened this issue Sep 10, 2023 · 4 comments

Comments

@yaronlevi
Copy link

Following the official docs and getting this error:

CleanShot 2023-09-10 at 18 18 51@2x

Any idea what might cause this?

@yaronlevi
Copy link
Author

yaronlevi commented Sep 10, 2023

Also, if I try this import (without brackets) I get this error:

CleanShot 2023-09-10 at 18 26 32@2x

@tmak
Copy link

tmak commented Sep 28, 2023

Currently, @axiomhq/js is unusable via ESM.

The following changes in packages/js/package.json would fix this:

  • Add "type": "module"
  • Change "default": "./dist/cjs/index.js" to "default": "./dist/esm/index.js"

That's how package.json for the pino and winston packages are configured. Is there any reason not to do the same for the js package?

@dasfmi
Copy link
Collaborator

dasfmi commented Sep 28, 2023

Hi we have a released a new version that fixes this build issue. It's still rc but maybe you could give it a try.

@dasfmi
Copy link
Collaborator

dasfmi commented Oct 16, 2023

should be fixed, feel free to open again if you are still facing the same issue.

@dasfmi dasfmi closed this as completed Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants