Telegram-Mini-Apps / reactjs-template

Telegram Mini Apps application template using React, tma.js, TypeScript and Vite.
https://t.me/tmajsbot/react_example
182 stars 61 forks source link

Unable to load app in telegram test account #11

Closed Th0rgal closed 3 months ago

Th0rgal commented 3 months ago

I'm encountering an issue when trying to load my webapp on Telegram using a local setup, following the instructions provided in the Telegram Mini Apps documentation to create a test environment. I got the same issue when trying on production bot with production app deployed on vercel.

Steps to Reproduce:

Expected Behavior:

The webapp should load correctly without any errors.

Actual Behavior:

The webapp fails to load and keeps loading indefinitely. The following error is observed in the console:

TypeError: undefined is not an object (evaluating 'window.TelegramGameProxy.receiveEvent')

Environment:

Screenshot 2024-07-03 at 14 09 04
heyqbnk commented 3 months ago

Seems like Telegram is sending an event, when the application is not even loaded. Try running the code not in the test environment

Th0rgal commented 3 months ago

Hey, actually I tried loading it in normal environment too with the production build but this didn't work. If you want to try my final build is accessible at redacted

Th0rgal commented 3 months ago

Update: I also tried with nextjs template, both in prod and test and it didn't work. I will try with telegram sdk.

Th0rgal commented 3 months ago

Update: I actually started telegram beta for mac from Downloads directly, I moved it to Applications, it prompted me to update which I did, and now I can load the webview