Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: "Uncaught TypeError: Class constructor c cannot be invoked without 'new'" in Yandex Browser #34067

Open
nektobit opened this issue Nov 27, 2024 · 8 comments
Labels

Comments

@nektobit
Copy link

Bug: "Uncaught TypeError: Class constructor c cannot be invoked without 'new'" in Yandex Browser

When attempting to run Rocket.Chat in the Yandex Browser (https://browser.yandex.com/), the application fails to load and throws a Uncaught TypeError: Class constructor c cannot be invoked without 'new' error in the console. This issue prevents the application from functioning as expected.

Steps to reproduce:

  1. Open Yandex Browser.
  2. Navigate to the Rocket.Chat application.
  3. Observe the console for errors.

Expected behavior:

The Rocket.Chat application should load and function correctly in Yandex Browser without any errors.

Actual behavior:

The application fails to load, and the following error appears in the console:

RestApiClient.ts:8

Uncaught TypeError: Class constructor c cannot be invoked without 'new' at new t (RestApiClient.ts:8:21) at RestApiClient.ts (RestApiClient.ts:27:26) at g (url_common.js:80:1) at d.require (url_common.js:80:1) at d.u [as link] (verifyErrors.js:34:1) at SDKClient.ts (SDKClient.ts:3:48) at g (url_common.js:80:1) at d.require (url_common.js:80:1) at d.u [as link] (verifyErrors.js:34:1) at CachedCollection.ts (CachedCollection.ts:2:48)

Additional context:

This issue seems to be specific to Yandex Browser and does not occur in other commonly used browsers (e.g., Chrome, Firefox). Compatibility with Yandex Browser may need to be reviewed.

Server Setup Information:

  • Version of Rocket.Chat Server: ( 6.13.0)
  • License Type: (open-source)
  • Number of Users: (1)
  • Deployment Method: (docker)
  • Number of Running Instances: (1)
  • DB Replicaset Oplog: (Disabled)
  • NodeJS Version: (14.21.3)
  • MongoDB Version: (6.0.10)

Client Setup Information:

  • Browser Version: Yandex Browser (latest version as of issue date)
  • Operating System: (Windows)
@code-arnab
Copy link

code-arnab commented Nov 28, 2024

Hey @nektobit it looks a long running issue with the browser UAs for Yandex (User Agents) or how we determine if a browser is compatible or not.
This might be a relevant thread with some good explanations - #25600.
In the meantime I will try to find a permanent solution to this.

@nektobit
Copy link
Author

nektobit commented Nov 28, 2024

Hey @nektobit it looks a long running issue with the browser UAs for Yandex (User Agents) or how we determine if a browser is compatible or not. This might be a relevant thread with some good explanations - #25600. In the meantime I will try to find a permanent solution to this.

<iframe src="https://dev.chat.ru/direct/abc/?layout=embedded&?isModern=true"></iframe>

It would be good to have some sort of "handle" on the client side as a temporary solution to disable the check. This way, we could turn off "isModern" check specifically for the Yandex browser by identifying it in the user agent.

@code-arnab
Copy link

code-arnab commented Nov 28, 2024

Yeah, that could be a temporary solution to this by sticking to "web.server" and not using "web.server.legacy". A long term solution might involve making changes to the "modern.js" in the Meteor package itself to extend support.
I'll try these locally and see if everything works fine.

@nektobit
Copy link
Author

nektobit commented Dec 4, 2024

Yeah, that could be a temporary solution to this by sticking to "web.server" and not using "web.server.legacy". A long term solution might involve making changes to the "modern.js" in the Meteor package itself to extend support. I'll try these locally and see if everything works fine.

Hi! I would be grateful for any new details you could provide 😊

@code-arnab
Copy link

code-arnab commented Dec 4, 2024

Yeah, that could be a temporary solution to this by sticking to "web.server" and not using "web.server.legacy". A long term solution might involve making changes to the "modern.js" in the Meteor package itself to extend support. I'll try these locally and see if everything works fine.

Hi! I would be grateful for any new details you could provide 😊

Hey @nektobit actually I was trying to setup your version of the Rocket.Chat server source code for local development but I couldn't since it requires 12+ GB RAM and after having a discussion with a maintainer yesterday on the channel (open.rocket.chat) it looks like I can't setup it up unless I bump my hardware.

You can ask the fellow contributors/maintainers here it is quite active - https://forums.rocket.chat/c/community-support/7


Or if you build locally you can get it work for you -

  1. By doing like this user adding return true directly into the isModern function locally - Rocket.Chat (4.7.1) not working on Yandex browser #25600 (comment)
    or,
  2. Adding an alias for Yandex like this locally - Firefox iOS is not marked as a modern brower meteor/meteor#13126
    Apparently Firefox IOS was having this problem at some point.

I think the 1st one might be a bit easier to do you just have to locate this function in a path like this - meteor/packages/modern-browsers/modern.js.

@reetp
Copy link

reetp commented Dec 9, 2024

I am referring this to the team for consideration but don't expect a rapid response.

@reetp reetp added the Tasked Added to the internal issue tracking label Dec 9, 2024
@casalsgh
Copy link
Contributor

casalsgh commented Dec 9, 2024

We'll check into it

@casalsgh
Copy link
Contributor

Folks, this will be a won't fix for the time being since we are not planning to support Yandex.
https://docs.rocket.chat/docs/support-prerequisites#browser-support

If you want to send a PR contribution to tackle it, please do and I'll see if I can get a review, but not an item that will be pursuing to fix.

@casalsgh casalsgh added wontfix and removed Tasked Added to the internal issue tracking labels Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants
@reetp @nektobit @casalsgh @code-arnab and others