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

Orama Cloud: error with web import #40

Closed
djibe opened this issue Sep 5, 2024 · 3 comments
Closed

Orama Cloud: error with web import #40

djibe opened this issue Sep 5, 2024 · 3 comments

Comments

@djibe
Copy link

djibe commented Sep 5, 2024

Describe the bug

No Orama Cloud import is possible from both jsdelivr and unpkg

Both import from jsDelivr and unpkg fail.

<script type="module">
import oramacloudclient from 'https://cdn.jsdelivr.net/npm/@oramacloud/[email protected]/+esm'
</script>
--> null has no properties
<script type="module">
import { OramaClient } from 'https://unpkg.com/@oramacloud/[email protected]/dist/index.global.js'
</script>
--> doesn't provide an export named: 'OramaClient'

Thank you very much.

To Reproduce

Steps above

Expected behavior

Import {OramaClient }

Environment Info

Firefox + Chrome latest

Oramacloud 1.3.14

Affected areas

Initialization

Additional context

No response

@micheleriva micheleriva transferred this issue from oramasearch/orama Sep 6, 2024
@micheleriva
Copy link
Member

Hey @djibe thanks for spotting this!

@faustoq, @matijagaspar, @allevo, can you please look at this?

matijagaspar added a commit that referenced this issue Sep 6, 2024
@matijagaspar
Copy link
Contributor

matijagaspar commented Sep 6, 2024

Merged a fix, next release should work, but must import dist/index.js because dist/index.global.js is not esm but iffe

<script type="module">
import { OramaClient } from 'https://unpkg.com/@oramacloud/[email protected]/dist/index.js'
</script>

@djibe
Copy link
Author

djibe commented Sep 7, 2024

Works perfectly. Many thanks !

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