SCRIPT1028: SCRIPT1028: Expected identifier, string or number

Hi guys,

I’m working on Ionic app ("@ionic/react": “^5.4.1”) as my first Ionic project, on which everything works fine, but it seems that on some browsers (Edge and it seems older versions of others like Chrome, Safari…) application just shows blank white page and throws an error: SCRIPT1028: SCRIPT1028: Expected identifier, string or number.

Debugger is pointing me to spread operator (…styles) in 1.chunk.js :

const proto = Object.defineProperties(() => {}, {
	...styles,
	level: {
		enumerable: true,
		get() {
			return this._generator.level;
		},
		set(level) {
			this._generator.level = level;
		}
	}
});

It looks like spread operator isn’t supported by these browsers?

Can anyone help me how to overcome this? Is it possible that transpiler is transpiling to some version of js unsupported by these browsers? How to overcome this situation, does anyone has solution or some clue? I need to roll out app on some older browsers.

If someone need additional details just let me know which one?

Thnks in advance!
Aleksandar

Hi @Stojko, here’s the browser support table for Ionic 5: https://ionicframework.com/docs/reference/browser-support#desktop-browsers

We don’t support non-chromium Edge in Ionic 5.

Also, here’s the browser support matrix for the spread operator, which is widely supported in all modern browsers: https://caniuse.com/?search=spread%20operator

I will share this w/ the framework team but it’s not likely we will make a change here to support out of date browsers on this one.

@max thnx for fast reply.