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

Is the adapter compatible with vite/ESM? #199

Open
Mat-moran opened this issue Mar 6, 2024 · 4 comments
Open

Is the adapter compatible with vite/ESM? #199

Mat-moran opened this issue Mar 6, 2024 · 4 comments

Comments

@Mat-moran
Copy link

Description

Hi, when I try to run a page with the react example in a remix route it launches an error
image

I think it is related with CJS/ESM

Steps to reproduce

Create a new Remix Vite app: npx create-remix@latest --template remix-run/remix/templates/vite
In the index route for example copy the React example code

Expected Behavior

Actual Behavior

The application is broken

Metadata

Typesense Version:
Latest

OS:
MacOS

Remix v2.8 Vite

@grinkus-adapt
Copy link

Not a solution, but a very ugly workaround I found that might help for now:

import TypesenseInstantSearchAdapterExport from "typesense-instantsearch-adapter";
const TypesenseInstantSearchAdapter =
  TypesenseInstantSearchAdapterExport.default ??
  TypesenseInstantSearchAdapterExport;

@Mat-moran
Copy link
Author

Thanks you so much, it seems to work.

Let's see if I can make something! 😄

@Nedi11
Copy link

Nedi11 commented Jun 5, 2024

Can we please get a proper fix for this

@djdembeck
Copy link

Would like a full fix for this, but I worked around it using https://github.com/cyco130/vite-plugin-cjs-interop

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

4 participants