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

Error on IPHONE 5s running 12.9.7 #11724

Open
BrianUK1234 opened this issue Mar 28, 2024 · 4 comments
Open

Error on IPHONE 5s running 12.9.7 #11724

BrianUK1234 opened this issue Mar 28, 2024 · 4 comments

Comments

@BrianUK1234
Copy link

Expected behavior

Screenshot 2024-03-28 at 14 19 24
I dont know if its to do with support for the static keyword but apparently that support was added IOS 9 It works fine on later versions of IPHONES and IOS, I know its an old phone, so not the end of the earth.

Current behavior

It generates a syntax error

Reproducible sample

Sent screen shot of syntax error

Optional extra steps/info to reproduce

[Error] SyntaxError: Unexpected token '='. Expected an opening '(' before a method's parameter list.

(anonymous function) (chart-full.js:3587)

the chart-full.js I expanded your min file as thats the only one I had, if you look at the screen shot hopefully you will recognise the code, I hope this helps

Possible solution

No response

Context

Just testing it on all the old phones I have available, it failed on an old one

chart.js version

v4,4.2

Browser name and version

Safari on IOS 12.9.7

Link to your project

No response

@DAcodedBEAT
Copy link
Contributor

(I'm just a fellow user of this library but I think I found the issue) It looks like the provided code was not supported by the Javascript engine used on that platform.

According to https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Public_class_fields, it looks like public static fields was only supported as of Safari 14.1, which shipped with iOS & iPadOS 14.5 and macOS Big Sur 11.3 (from https://developer.apple.com/documentation/safari-release-notes/safari-14_1-release-notes).

Since the library is targeting ES6 (per https://github.com/chartjs/Chart.js/blob/v4.4.2/tsconfig.json#L31) and this was a bug in the implementation of the language spec for JavaScriptCore in Webkit (Safari), I wouldn't expect this to get fixed but who knows, maybe the maintainers of this project might be open to it 🤷

@BrianUK1234
Copy link
Author

(I'm just a fellow user of this library but I think I found the issue) It looks like the provided code was not supported by the Javascript engine used on that platform.

According to https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Public_class_fields, it looks like public static fields was only supported as of Safari 14.1, which shipped with iOS & iPadOS 14.5 and macOS Big Sur 11.3 (from https://developer.apple.com/documentation/safari-release-notes/safari-14_1-release-notes).

Since the library is targeting ES6 (per https://github.com/chartjs/Chart.js/blob/v4.4.2/tsconfig.json#L31) and this was a bug in the implementation of the language spec for JavaScriptCore in Webkit (Safari), I wouldn't expect this to get fixed but who knows, maybe the maintainers of this project might be open to it 🤷

Thanks Arun, for looking into it, It was an old phone, so your comments about safari are more than likely to be correct, I was just doing belt and braces testing. I wouldnt want anybody wasting time, but I thought I would flag it.

Thanks again

@DAcodedBEAT
Copy link
Contributor

@chartjs do you all think this is worth fixing? what are the minimum supported target versions?

@BrianUK1234
Copy link
Author

In all honesty I mentioned it to give beck, I dont want any body to go to effort, Iphone 5's are now old and why limit the development of a super project, I can always go back to an earlier version of chart JS, but I dont think the demand is there

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

No branches or pull requests

2 participants