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

Bug: Syntax Error with Jest in ESM #418

Open
3 tasks done
eryue0220 opened this issue May 22, 2024 · 3 comments
Open
3 tasks done

Bug: Syntax Error with Jest in ESM #418

eryue0220 opened this issue May 22, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@eryue0220
Copy link

Describe the bug

When run test through Jest in ESM, it will occur an error like:
image

Steps to reproduce

  1. git clone https://github.com/eryue0220/usearch-jest-esm-bug
  2. cd usearch-jest-esm-bug
  3. pnpm i
  4. pnpm test

Expected behavior

It should pass without babel transform the code.

USearch version

2.11.1

Operating System

Mac OSX

Hardware architecture

Arm

Which interface are you using?

Other bindings

Contact Details

No response

Are you open to being tagged as a contributor?

  • I am open to being mentioned in the project .git history as a contributor

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct
@eryue0220 eryue0220 added the bug Something isn't working label May 22, 2024
@eryue0220
Copy link
Author

Currently, A workaround is provide a transform in jest to remove module.exports in source code: https://github.com/eryue0220/usearch-jest-esm-bug/blob/main/jest.config.mjs#L5

@ashvardanian
Copy link
Contributor

ashvardanian commented May 22, 2024

I am very inexperienced in JS tooling. Any chance you could open a PR if you know how to fix that, @eryue0220?

@eryue0220
Copy link
Author

I am very inexperienced in JS tooling. Any chance you could open a PR if you know how to fix that, @eryue0220?

Sure, I will fix this later.

ashvardanian pushed a commit that referenced this issue May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants