question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bug: node-fetch require error

See original GitHub issue

Bug: I have cloned the repo for the first time, ran npm install, and npm run dev. The following error is presented:

Error [ERR_REQUIRE_ESM]: require() of ES Module /home/jonatan/git/chat-e2ee/node_modules/node-fetch/src/index.js from /home/jonatan/git/chat-e2ee/backend/external/imgbb.js not supported.
Instead change the require of index.js in /home/jonatan/git/chat-e2ee/backend/external/imgbb.js to a dynamic import() which is available in all CommonJS modules.

Steps to Reproduce:

  1. clone the repository
  2. run npm install
  3. run npm run dev

Context: System: Ubuntu 20.04.3 LTS Node version: v16.14.1

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jonatan5524commented, Mar 18, 2022

Thank you, maybe worth adding this wiki page to the contributing guidelines, I will be happy to do it after this issue.

0reactions
muke1908commented, Mar 18, 2022

Try following this document: https://github.com/muke1908/chat-e2ee/wiki/ENV-variables

You can message here, if you need any help. https://gitter.im/chat-e2ee/community

Read more comments on GitHub >

github_iconTop Results From Across the Web

require('node-fetch') gives ERR_REQUIRE_ESM
This module was converted to be a ESM only package in version 3.0.0-beta.10 . node-fetch is an ESM-only module — you are not...
Read more >
node-fetch doesn't throw an error when downloading a big file ...
When downloading a file bigger than 4 GiB (= 2 32 bytes) with http in a 32-bit environment, Node.js fails and throws the...
Read more >
How to make a fetch request using node-fetch v3 - Netlify
This error message is letting us know that we are unable to use the require() syntax since it only works with CommonJS. Node-fetch...
Read more >
Errors | Node.js v19.3.0 Documentation
For all EventEmitter objects, if an 'error' event handler is not provided, the error will be thrown, causing the Node.js process to report...
Read more >
Unable to import `node-fetch` in service
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found