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

Error [ERR_REQUIRE_ESM]: require() of ES Module #16

Open
Oladapodaniel opened this issue Feb 26, 2024 · 0 comments
Open

Error [ERR_REQUIRE_ESM]: require() of ES Module #16

Oladapodaniel opened this issue Feb 26, 2024 · 0 comments

Comments

@Oladapodaniel
Copy link

Hello,
i just installed the library, i calling the explore endpoint, but i get an error

/Users/apple/Documents/react-native/audiobook/server/node_modules/audiobookbay/dist/utils/searchAudiobooks.js:17
const node_fetch_1 = __importDefault(require("node-fetch"));
^

Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/apple/Documents/react-native/audiobook/server/node_modules/audiobookbay/node_modules/node-fetch/src/index.js from /Users/apple/Documents/react-native/audiobook/server/node_modules/audiobookbay/dist/utils/searchAudiobooks.js not supported.
Instead change the require of index.js in /Users/apple/Documents/react-native/audiobook/server/node_modules/audiobookbay/dist/utils/searchAudiobooks.js to a dynamic import() which is available in all CommonJS modules.
at Object. (/Users/apple/Documents/react-native/audiobook/server/node_modules/audiobookbay/dist/utils/searchAudiobooks.js:17:38)
at Object. (/Users/apple/Documents/react-native/audiobook/server/node_modules/audiobookbay/dist/index.js:16:28)
at async Promise.all (index 0) {
code: 'ERR_REQUIRE_ESM'
}

how can this be fixed, I'm new to this.
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

1 participant