Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting the error "Module not found: Error: Can't resolve 'querystring'", how do I fix this?

After installing react-instagram-embed package I got this error and tried all possible solution but still not working!!! Anyone knows solution for this??

Module not found: Error: Can't resolve 'querystring' in 'C:\Users\vytck\Desktop\ibm\node_modules\finnhub\dist'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:

  • add a fallback 'resolve.fallback: { "querystring": require.resolve("querystring-es3") }'
  • install 'querystring-es3' If you don't want to include a polyfill, you can use an empty module like this: resolve.fallback: { "querystring": false }
like image 307
payal_harwani Avatar asked Apr 08 '26 12:04

payal_harwani


1 Answers

querystring is deprecated since at least since last Node LTS version 14.

So if you want to keep your current version of react-instagram-embed

install querystring-es3

yarn add querystring-es3 or npm i querystring-es3

in your webpack.config.js configuration file update or add the resolve entry to look like this

resolve: {
   fallback: { "querystring": require.resolve("querystring-es3") }
}
like image 168
Nwawel A Iroume Avatar answered Apr 10 '26 02:04

Nwawel A Iroume



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!