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

Flexible sync type definitions require strictNullChecks to be enabled #4552

Closed
tomduncalf opened this issue May 3, 2022 · 0 comments · Fixed by #4562
Closed

Flexible sync type definitions require strictNullChecks to be enabled #4552

tomduncalf opened this issue May 3, 2022 · 0 comments · Fixed by #4562

Comments

@tomduncalf
Copy link
Contributor

tomduncalf commented May 3, 2022

The type definitions for flexible sync require strictNullChecks to be enabled in the user's tsconfig.json otherwise they will get errors: https://github.com/realm/realm-js/blob/master/types/index.d.ts#L144-L145

I can't remember the details of why this is so, but Kræn and I did quite a bit of investigation and concluded that the type discrimination using the flexible: true and flexible?: false | undefined did not work properly without strict null checks. I think there was a somewhat logical explanation for this, I can try to cast my mind back if useful!

We thought this would be a non-issue in practice for the majority of users, but unfortunately it turns out that Expo defaults to strict mode disabled so there is a chance that Expo users will hit this issue. I'm not sure if there is a good workaround, but it warrants further investigation.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2024
@sync-by-unito sync-by-unito bot changed the title Flexible sync type definitions require strictNullChecks to be enabled Flexible sync type definitions require strictNullChecks to be enabled Mar 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant