morethanwords / tweb

Telegram Web K, GPL v3
https://web.telegram.org/k/
GNU General Public License v3.0
1.86k stars 595 forks source link

[BUG] Can't build with disable websockets #231

Closed fly3110 closed 10 months ago

fly3110 commented 1 year ago

The project won't build with

const MTPROTO_HTTP = true;
const MTPROTO_AUTO = false;

To Reproduce set the above constants to the above values (no other changes)

Expected behavior Project builds successfully

Actual behaviour

WARNING in ./src/lib/mtproto/apiManager.ts 89:32-61
export 'constructTelegramWebSocketUrl' (imported as 'constructTelegramWebSocketUrl') was not found in './dcConfigurator' (possible exports: DcConfigurator, getTelegramConnectionSuffix)
 @ ./src/lib/appManagers/createManagers.ts 32:0-51 76:24-34
 @ ./src/lib/appManagers/appManagersManager.ts 23:0-46 76:35-49
 @ ./src/lib/mtproto/mtproto.worker.ts 15:0-67 78:39-69 108:0-24 109:0-30
 @ ./src/lib/mtproto/mtprotoworker.ts
 @ ./src/index.ts

ERROR in /usr/local/www/sites/xmessages/tweb/src/lib/mtproto/apiManager.ts
./src/lib/mtproto/apiManager.ts 23:24-53
[tsl] ERROR in /usr/local/www/sites/xmessages/tweb/src/lib/mtproto/apiManager.ts(23,25)
      TS2305: Module '"./dcConfigurator"' has no exported member 'constructTelegramWebSocketUrl'.
 @ ./src/lib/appManagers/createManagers.ts 32:0-51 76:24-34
 @ ./src/lib/appManagers/appManagersManager.ts 23:0-46 76:35-49
 @ ./src/lib/mtproto/mtproto.worker.ts 15:0-67 78:39-69 108:0-24 109:0-30
 @ ./src/lib/mtproto/mtprotoworker.ts
 @ ./src/index.ts

ERROR in /usr/local/www/sites/xmessages/tweb/src/lib/mtproto/apiManager.ts
./src/lib/mtproto/apiManager.ts 440:72-83
[tsl] ERROR in /usr/local/www/sites/xmessages/tweb/src/lib/mtproto/apiManager.ts(440,73)
      TS2304: Cannot find name 'MTTransport'.
 @ ./src/lib/appManagers/createManagers.ts 32:0-51 76:24-34
 @ ./src/lib/appManagers/appManagersManager.ts 23:0-46 76:35-49
 @ ./src/lib/mtproto/mtproto.worker.ts 15:0-67 78:39-69 108:0-24 109:0-30
 @ ./src/lib/mtproto/mtprotoworker.ts
 @ ./src/index.ts

... and lots of the above errors

Desktop (please complete the following information):