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

Livechat widget broken in legacy browsers #12864

Closed
edurenye opened this issue Dec 5, 2018 · 11 comments · Fixed by #12975
Closed

Livechat widget broken in legacy browsers #12864

edurenye opened this issue Dec 5, 2018 · 11 comments · Fixed by #12975

Comments

@edurenye
Copy link

edurenye commented Dec 5, 2018

Description:

When I enter a page with the livechat widget active in ie11, I get the following error:
SCRIPT1002: Syntax error
File: livechat.js, Line: 27, Column: 289

I went to that line and expanded it, it contains the following (I put a mark in the error placement):

!function() {
	var e = Package.meteor.Meteor, o = Package.meteor.global, t = Package.meteor.meteorEnv,
		s = Package.modules.meteorInstall, a = Package['babel-runtime'].meteorBabelHelpers, r = Package.promise.Promise,
		n, c, l = s({
			node_modules: {
				meteor: {
					webapp: {
						'webapp_client.js': function(e, o, t) {
							t.export({ WebApp: () => s }); <- The error happens here in the '()'
							const s = { _isCssLoaded: () => 0 === document.styleSheets.length || Array.prototype.find.call(document.styleSheets, e => e.cssText && !e.cssRules ? !e.cssText.match(/meteor-css-not-found-error/) : !Array.prototype.find.call(e.cssRules, e => '.meteor-css-not-found-error' === e.selectorText)) };
						},
					},
				},
			},
		}, { extensions: ['.js', '.json'] })('/node_modules/meteor/webapp/webapp_client.js');
	Package._define('webapp', l, { WebApp: void 0 });
}();

Expected behavior:

It works in other browsers so it should work here also.

Actual behavior:

The widget is not rendered due to the error.

Server Setup Information:

  • Version of Rocket.Chat Server: 0.72.0
  • Operating System: linux
  • Deployment Method: tar and docker
  • Number of Running Instances: 1
@edurenye
Copy link
Author

edurenye commented Dec 5, 2018

I could not find from where this code came from, might be a dependence or something is hard to find with the minifications and transformations that it suffers.

@edurenye
Copy link
Author

edurenye commented Dec 6, 2018

I think this might be related to this other issue in meteor: meteor/meteor#10274

@edurenye
Copy link
Author

edurenye commented Dec 6, 2018

I found the root of the problem, but I don't know how to fix it.
In IE11 is using this file:
.meteor/local/build/programs/web.browser/packages/webapp.js
when it should use:
.meteor/local/build/programs/web.browser.legacy/packages/webapp.js

@edurenye
Copy link
Author

edurenye commented Dec 6, 2018

I also have this error on Safari 5.1
There it says:
SyntaxError: Unexpected token ')'
SYNTAX_ERR: DOM Exception 12: An invalid or illegal string was specified.
Pointing to the same line on the same file.

@tassoevan tassoevan self-assigned this Dec 6, 2018
@edurenye
Copy link
Author

edurenye commented Dec 7, 2018

Related issue: meteor/meteor#9818

@edurenye
Copy link
Author

Looks like this was due to this PR #12468 they actually updated livechat meteor to 1.9.2

@edurenye edurenye changed the title Livechat widget error in ie11 Livechat widget broken in legacy browsers Dec 11, 2018
@owengombas
Copy link

Same issue here

@edurenye
Copy link
Author

IMHO, I don't think is really a solution to use legacy always, I think it should chose one or the other depending on the browser, isn't it? Maybe I'm wrong.

@rodrigok
Copy link
Member

@edurenye we are developing a new livechat frontend and we hope it will be ready next month (January 2019). It will use webpack as build system and React as UI framework, and will fully replace the current one, that's why I don't think you need to worry about this workaround.

@edurenye
Copy link
Author

There is a PR for that React version?

@tassoevan
Copy link
Contributor

@edurenye It is at another repo at the moment: https://github.com/RocketChat/Rocket.Chat.Livechat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants