Telegram-Mini-Apps / TelegramUI

React components library for Telegram Mini Apps inspired by Telegram interface
https://ton.org/mini-apps
MIT License
59 stars 5 forks source link

Add SSR Support #12

Closed bshelkhonov closed 1 month ago

bshelkhonov commented 1 month ago

I'm making my application in NextJS. Code fails to compile because of this line: https://github.com/XeleneStudio/TelegramUI/blob/main/src/components/Service/AppRoot/hooks/useAppearance.ts#L17

node_modules/@xelene/tgui/dist/helpers/telegram.js (3:4) @ getTelegramData
Internal error: ReferenceError: window is not defined
at getTelegramData (./node_modules/@xelene/tgui/dist/helpers/telegram.js:7:5)
at useAppearance (./node_modules/@xelene/tgui/dist/components/Service/AppRoot/hooks/useAppearance.js:20:92)
at eval (./node_modules/@xelene/tgui/dist/components/Service/AppRoot/AppRoot.js:41:156)
mainsmirnov commented 1 month ago

Hi, we fixed this issue in version 2.0.6

https://github.com/XeleneStudio/TelegramUI/commit/8eceb90c86e2b0eb0b2cb0dbbf073949f660bfcb