Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

ERROR in ./node_modules/midtrans-client/lib/httpClient.js 9:18-40 Module not found: Error: Can't resolve 'querystring' in 'C:\Users\[Username]\Documents\[Project-name]\node_modules\midtrans-client\lib' #55

Closed
DafiRamadhan opened this issue Feb 21, 2023 · 1 comment

Comments

@DafiRamadhan
Copy link

Halo. Saya ingin bertanya. Saya mengerjakan projek react.js dan ingin menggunakan library ini. Saya menginstallnya dengan menggunakan npm install midtrans-nodejs-client. Tetapi setelah itu, saat saya mencoba memanggilnya menggunakan const midtransClient = require('midtrans-client'); muncul pesan error berikut :

ERROR in ./node_modules/midtrans-client/lib/httpClient.js 9:18-40
Module not found: Error: Can't resolve 'querystring' in 'C:\Users[Username]\Documents[Project-name]\node_modules\midtrans-client\lib'

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 }

Saya mohon bantuannya. Terimakasih

@DafiRamadhan
Copy link
Author

Solved

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant