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

Usage of nullish coalescing syntax errors when running in some browser versions #1792

Open
jfernandezgersol opened this issue Jun 17, 2022 · 0 comments

Comments

@jfernandezgersol
Copy link

Hi,

I updated the library to a newer version in my project (3.0.0) and I was getting some strange errors running tests with Karma and Jasmine:

Chrome 68.0.3419.0 (Windows 10) ERROR An error was thrown in afterAll Uncaught SyntaxError: Unexpected token ? Chrome 68.0.3419.0 (Windows 10) ERROR An error was thrown in afterAll Uncaught SyntaxError: Unexpected token ? SyntaxError: Unexpected token ? Chrome 68.0.3419.0 (Windows 10): Executed 0 of 0 ERROR (0 secs / 0 secs) Chrome 68.0.3419.0 (Windows 10) ERROR An error was thrown in afterAll Uncaught SyntaxError: Unexpected token ? SyntaxError: Unexpected token ?

After some research, I detected that the problem was related with the apollo-angular library, concretely with the following line:

options.useMutationLoading ?? this.useMutationLoading

referenced in:

options.useMutationLoading ?? this.useMutationLoading,

I am using Chrome Headles v68.0.3419.0 to run the tests and the nullish coalescing operator is not recognized.

After some further research, I realized that the support of this operator is relatively new in Safari for iOS too (from iOS version 13.3).

https://caniuse.com/mdn-javascript_operators_nullish_coalescing

I suppose, that this line can be changed to not use ?? and then the browser compatibility won't be reduced.

Thanks in advance!

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

No branches or pull requests

1 participant