-
-
Notifications
You must be signed in to change notification settings - Fork 79
Description
I've initially reported it here: rolldown/rolldown#6438 but they said it's recommended to be fixed in typesense-instantsearch-adapter instead.
When importing typesense-instantsearch-adapter you get different results with rollup vs esbuild vs rolldown when bundling.
- rolldown:
{ default: [Function: TypesenseInstantsearchAdapter] } - rollup:
[Function: TypesenseInstantsearchAdapter]
publint has a warning for this here: https://publint.dev/[email protected]
This file sets both exports.__esModule = true and exports.default. This pattern breaks default imports when importing from an ESM-interpreted file in some bundlers. Consider using ESM syntax instead of CommonJS with __esModule or avoid the default export. https://publint.dev/rules#cjs_with_esmodule_default_export
Unfortunately, I don't know enough about this to be able to fix it. Maybe you have an idea.
I've currently worked it around in my code using:
import TypesenseInstantSearchAdapter from 'typesense-instantsearch-adapter';
let TypesenseInstantSearchAdapterClass =
TypesenseInstantSearchAdapter.default ?? TypesenseInstantSearchAdapter;