Ask Your Question
0

What is the issue with importing node-fetch when using ES modules that is not supported?

asked 2021-09-08 11:00:00 +0000

huitzilopochtli gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-06-03 02:00:00 +0000

bukephalos gravatar image

When using ES modules, importing node-fetch module may result in an error because node-fetch is not an ES module and is not supported by the ES module system. This is because node-fetch is implemented using CommonJS module syntax and not native ES module syntax. Therefore, it cannot be imported directly in an ES module. To use node-fetch in an ES module, developers need to use a bundler like webpack or rollup that can handle CommonJS modules and convert them to ES modules.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2021-09-08 11:00:00 +0000

Seen: 8 times

Last updated: Jun 03 '21