0perationPrivacy / VoIP

Web Base Telnyx/Twilio VoIP Interface enabling SMS, MMS and Voice calls using the providers API Keys and self-hosting the application.
https://VoIP.OperationPrivacy.com
GNU General Public License v3.0
238 stars 421 forks source link

App not starting : ReferenceError: TextEncoder is not defined #209

Closed slfhstr closed 1 year ago

slfhstr commented 1 year ago
# /root/VoIP/node_modules/openpgp/dist/node/openpgp.min.js:2
"use strict";const e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};Object.defineProperty(exports,"__esModule",{value:!0});var t=require("buffer"),r=require("stream"),i=require("crypto"),n=require("zlib"),a=require("os"),s=require("util"),o=require("asn1.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=/*#__PURE__*/c(t),h=/*#__PURE__*/c(r),d=/*#__PURE__*/c(i),f=/*#__PURE__*/c(n),l=/*#__PURE__*/c(a),p=/*#__PURE__*/c(s),y=/*#__PURE__*/c(o);const b=Symbol("doneWritingPromise"),m=Symbol("doneWritingResolve"),g=Symbol("doneWritingReject"),w=Symbol("readingIndex");class v extends Array{constructor(){super(),this[b]=new Promise(((e,t)=>{this[m]=e,this[g]=t})),this[b].catch((()=>{}))}}function _(e){return e&&e.getReader&&Array.isArray(e)}function k(e){if(!_(e)){const t=e.getWriter(),r=t.releaseLock;return t.releaseLock=()=>{t.closed.catch((function(){})),r.call(t)},t}thi

ReferenceError: TextEncoder is not defined
    at Object.encodeUTF8 (/root/VoIP/node_modules/openpgp/dist/node/openpgp.min.js:2:18136)
    at Object.<anonymous> (/root/VoIP/node_modules/openpgp/dist/node/openpgp.min.js:2:201012)
    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> (/root/VoIP/app/controller/email.controller.js:2:17)
    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)

How to debug / resolve ?

huzaifa3115 commented 1 year ago

It seems that opengp is not properly installed, Please try following commands rm -rf node_modules & rm -rf package & npm i & npm install --save openpgp

slfhstr commented 1 year ago

Thank you 😄 I ran those commands (as single line and individually) and they complete without errors. But I still get the same error :

node app.js
/root/VoIP/node_modules/openpgp/dist/node/openpgp.min.js:2
"use strict";const e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};Object.defineProperty(exports,"__esModule",{value:!0});var t=require("buffer"),r=require("stream"),i=require("crypto"),n=require("zlib"),a=require("os"),s=require("util"),o=require("asn1.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=/*#__PURE__*/c(t),h=/*#__PURE__*/c(r),d=/*#__PURE__*/c(i),f=/*#__PURE__*/c(n),l=/*#__PURE__*/c(a),p=/*#__PURE__*/c(s),y=/*#__PURE__*/c(o);const b=Symbol("doneWritingPromise"),m=Symbol("doneWritingResolve"),g=Symbol("doneWritingReject"),w=Symbol("readingIndex");class v extends Array{constructor(){super(),this[b]=new Promise(((e,t)=>{this[m]=e,this[g]=t})),this[b].catch((()=>{}))}}function _(e){return e&&e.getReader&&Array.isArray(e)}function k(e){if(!_(e)){const t=e.getWriter(),r=t.releaseLock;return t.releaseLock=()=>{t.closed.catch((function(){})),r.call(t)},t}thi

ReferenceError: TextEncoder is not defined
    at Object.encodeUTF8 (/root/VoIP/node_modules/openpgp/dist/node/openpgp.min.js:2:18136)
    at Object.<anonymous> (/root/VoIP/node_modules/openpgp/dist/node/openpgp.min.js:2:201012)
    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> (/root/VoIP/app/controller/email.controller.js:2:17)
    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)

Any thoughts ?

slfhstr commented 1 year ago

I have got this app working in a new build using Docker (moving away from self-hosted using a LXC implementation). So this issue goes away I think. I will close it. Thank you for looking at it and your advice to resolve.