It works fine in the local environment, but when I turn on the server on AWS, it returns the following error.
AWS: Ubuntu 20.04
Node: 17.7.1
Express: 4.17.3
ReferenceError: TextEncoder is not defined
at Object.<anonymous> (/home/ubuntu/mrheropurchaselogserver/node_modules/jose/dist/node/cjs/lib/buffer_utils.js:5:23)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (/home/ubuntu/mrheropurchaselogserver/node_modules/jose/dist/node/cjs/runtime/base64url.js:5:27)
at Module._compile (internal/modules/cjs/loader.js:778:30)
It works fine in the local environment, but when I turn on the server on AWS, it returns the following error.
AWS: Ubuntu 20.04 Node: 17.7.1 Express: 4.17.3