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

'default' is not exported by node_modules/algoliasearch/index.js #1487

Open
lukecharle opened this issue Sep 18, 2023 · 0 comments
Open

'default' is not exported by node_modules/algoliasearch/index.js #1487

lukecharle opened this issue Sep 18, 2023 · 0 comments

Comments

@lukecharle
Copy link

lukecharle commented Sep 18, 2023

I'm using rollup and experiencing the below error when trying to use import algoliasearch from "algoliasearch";

'default' is not exported by node_modules/algoliasearch/index.js

Yet that index.js does export default?

/* eslint-disable functional/immutable-data, import/no-commonjs */
const algoliasearch = require('./dist/algoliasearch.cjs.js');

/**
 * The Common JS build is the default entry point for the Node environment. Keep in
 * in mind, that for the browser environment, we hint the bundler to use the UMD
 * build instead as specified on the key `browser` of our `package.json` file.
 */
module.exports = algoliasearch;

/**
 * In addition, we also set explicitly the default export below making
 * this Common JS module in compliance with es6 modules specification.
 */
module.exports.default = algoliasearch;

I've tried using @rollup/plugin-commonjs as many others have said but this doesn't resolve anything.

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

1 participant