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

Single Fetch: Readonly arrays are not accepted as valid serialisable data in loader #9362

Closed
artursvonda opened this issue May 3, 2024 · 4 comments · Fixed by #9372
Closed

Comments

@artursvonda
Copy link

Reproduction

https://stackblitz.com/edit/remix-run-remix-a4chia?file=app%2Froutes%2F_index.tsx

System Info

System:
    OS: macOS 14.4.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 76.98 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 21.6.1 - ~/.nvm/versions/node/v21.6.1/bin/node
    npm: 10.2.4 - ~/.nvm/versions/node/v21.6.1/bin/npm
  Browsers:
    Chrome: 124.0.6367.119
    Safari: 17.4.1

Used Package Manager

npm

Expected Behavior

Types are correctly inferred

Actual Behavior

Loader data is inferred as never

@artursvonda
Copy link
Author

The solution should be just to add ReadonlyArray and other readonly types to Serializable type.

@brophdawg11 brophdawg11 changed the title Readonly arrays are not accepted as valid serialisable data in loader Single Fetch: Readonly arrays are not accepted as valid serialisable data in loader May 9, 2024
@brophdawg11
Copy link
Contributor

I think this is resolved by #9372 - we should have an prerelease out shortly to confirm.

@brophdawg11 brophdawg11 added the awaiting release This issue has been fixed and will be released soon label May 9, 2024
@brophdawg11 brophdawg11 linked a pull request May 9, 2024 that will close this issue
@brophdawg11
Copy link
Contributor

This fix is available in 2.9.2-pre.1 if you'd like to give it a shot and see if it resolves your issue! Here's the draft release notes: https://github.com/remix-run/remix/blob/release-next/CHANGELOG.md#v292

@brophdawg11 brophdawg11 removed the awaiting release This issue has been fixed and will be released soon label May 10, 2024
@brophdawg11
Copy link
Contributor

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.

2 participants