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

ESM is broken with Vite in 0.44.0 #1736

Closed
knd775 opened this issue Oct 3, 2024 · 3 comments · Fixed by #1737
Closed

ESM is broken with Vite in 0.44.0 #1736

knd775 opened this issue Oct 3, 2024 · 3 comments · Fixed by #1737
Assignees
Labels
bug Something isn't working

Comments

@knd775
Copy link

knd775 commented Oct 3, 2024

Description
When using exports in package.json, you need to use the .mjs extension. Publint explains this here:
https://publint.dev/meilisearch@0.44.0

Screenshots or Logs
image

Environment:

  • OS: Windows 11
  • meilisearch-js version: 0.44.0
@flevi29 flevi29 added the bug Something isn't working label Oct 3, 2024
@flevi29 flevi29 self-assigned this Oct 3, 2024
@ndaidong
Copy link

ndaidong commented Oct 4, 2024

Me too. Latest node on Debian and Arch.

I tried some different ways but nothing work:

import meilise from 'meilisearch'
import * as meilise from 'meilisearch'
import * as meilise from 'meilisearch/dist/bundles/meilisearch.esm.js'
import * as meilise from './node_modules/meilisearch/dist/bundles/meilisearch.esm.js'

const { MeiliSearch } = meilise

(node:28573) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use node --trace-warnings ... to show where the warning was created)

@flevi29 flevi29 mentioned this issue Oct 4, 2024
3 tasks
@flevi29
Copy link
Collaborator

flevi29 commented Oct 4, 2024

Thanks for the quick bug report, will fix.

@curquiza
Copy link
Member

curquiza commented Oct 4, 2024

thanks for the report, doing the release as soon as possible

@meili-bors meili-bors bot closed this as completed in 03130bf Oct 4, 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

Successfully merging a pull request may close this issue.

4 participants