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

[2.x] Fixed TypeScript Errors in React SSR Setup with Ziggy Props when Builds #430

Merged
merged 1 commit into from
Oct 17, 2024

Conversation

akr4m
Copy link
Contributor

@akr4m akr4m commented Oct 17, 2024

This PR fixes TypeScript errors encountered during the SSR build process for React. Specifically, two errors were addressed:

  1. Spread types may only be created from object types due to page.props.ziggy being of type unknown.
  2. TypeScript type issue when trying to access page.props.ziggy.location.

The updated code includes @ts-expect-error directives to bypass the type errors temporarily and allow successful builds.

A screenshot of the errors is attached for reference.
image

@akr4m
Copy link
Contributor Author

akr4m commented Oct 17, 2024

I just tested it again.
The error is showing when I'm using pnpm.

Using npm if fine.

@taylorotwell taylorotwell merged commit 9498185 into laravel:2.x Oct 17, 2024
12 of 17 checks passed
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

Successfully merging this pull request may close these issues.

2 participants