I have a Next.js app using near-api-js, and I'm getting this error.
It's confusing since I'm not using unencrypted_file_system_keystore anywhere.
error - ./node_modules/near-api-js/lib/key_stores/unencrypted_file_system_keystore.js:7:0
Module not found: Can't resolve 'fs'
Import trace for requested module:
./node_modules/near-api-js/lib/key_stores/index.js
P.S. This question is specifically about using near-api-js
. I'll update the answer when I learn of a better solution to this particular problem since there are known bugs in that library and my current answer below feels like a wonky workaround.