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

Qwik: Latest qwik release breaks types #168

Open
genox opened this issue Jan 10, 2024 · 14 comments
Open

Qwik: Latest qwik release breaks types #168

genox opened this issue Jan 10, 2024 · 14 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@genox
Copy link

genox commented Jan 10, 2024

Just upgraded to qwik 1.3.3 and it seems some types have been changed. A text input field component I based on https://modularforms.dev/qwik/guides/input-components throws TS errors for all defined FunctionProps.

@fabian-hiller
Copy link
Owner

Thank you for the hint! I will update the guide.

@fabian-hiller fabian-hiller self-assigned this Jan 11, 2024
@fabian-hiller fabian-hiller added the documentation Improvements or additions to documentation label Jan 11, 2024
@juanpmarin
Copy link

Wating for this upgrade too :)

@fabian-hiller
Copy link
Owner

Will update the guide and check the code next week. Its on my list.

@juanpmarin
Copy link

@fabian-hiller do you have to make changes in the library or can it be fixed just by changing the way the library is invoked?

@fabian-hiller
Copy link
Owner

I need to look into this. Some people have reported runtime errors with the new Qwik version.

@brandonpittman
Copy link
Contributor

I need to look into this. Some people have reported runtime errors with the new Qwik version.

Using this at work—no runtime errors, just type errors when building the app.

@fabian-hiller
Copy link
Owner

I think I have fixed everything. I will release a new version soon.

@fabian-hiller
Copy link
Owner

v0.23.0 is available

@juanpmarin
Copy link

juanpmarin commented Jan 19, 2024

@fabian-hiller I'm declaring ref like this for one of my components:

ref?: QRL<(element: Element) => void>;

Because I need to explicitly call ref from an useTask$ context, but types are not compatible:

Types of property 'ref' are incompatible.
      Type '(element: Element) => void' is not assignable to type 'QRL<(element: Element) => void>'.

@fabian-hiller
Copy link
Owner

Please try to remove QRL:

ref?: (element: Element) => void;

@juanpmarin
Copy link

juanpmarin commented Jan 19, 2024

If I remove QRL, the type error gets fixed in the Field, but breaks in the useTask$

When referencing "props" inside a different scope (useTask$), Qwik needs to serialize the value, however "props.ref" is a function, which is not serializable.

@fabian-hiller
Copy link
Owner

Ok. I will try to change the types to QRL<…>.

@fabian-hiller
Copy link
Owner

v0.23.1 is available

@juanpmarin
Copy link

@fabian-hiller everything compiles in my project now, thanks a lot!

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

No branches or pull requests

4 participants