Skip to content

Type error in image-crop.tsx #15

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
javier-godoy opened this issue Feb 13, 2025 · 0 comments · May be fixed by #16
Open

Type error in image-crop.tsx #15

javier-godoy opened this issue Feb 13, 2025 · 0 comments · May be fixed by #16
Assignees

Comments

@javier-godoy
Copy link
Member

Describe the bug

[ERROR] src/main/frontend/src/image-crop.tsx(51,8): error TS2769: No overload matches this call.
[ERROR]   Overload 1 of 2, '(crop: Pick<PercentCrop, "unit"> & Partial<Omit<PercentCrop, "unit">>, aspect: number, containerWidth: number, containerHeight: number): PercentCrop', gave the following error.
[ERROR]     Type '"px" | "%"' is not assignable to type '"%"'.
[ERROR]       Type '"px"' is not assignable to type '"%"'.
[ERROR]   Overload 2 of 2, '(crop: Pick<PixelCrop, "unit"> & Partial<Omit<PixelCrop, "unit">>, aspect: number, containerWidth: number, containerHeight: number): PixelCrop', gave the following error.
[ERROR]     Type '"px" | "%"' is not assignable to type '"px"'.
[ERROR]       Type '"%"' is not assignable to type '"px"'.

Expected behavior

Source code should compile

Minimal reproducible example

Please find attached (check the sources under src/main/frontend).
ImageCrop.zip

Add-on Version

1.1.1-SNAPSHOT

Vaadin Version

24.6.5

Additional information

See https://github.com/dominictobias/react-image-crop/blob/e9220b188295663a55bc08c4d6efd63077e01c22/src/utils.ts#L23

@javier-godoy javier-godoy self-assigned this Feb 13, 2025
@github-project-automation github-project-automation bot moved this to Inbox (needs triage) in Flowing Code Addons Feb 13, 2025
javier-godoy added a commit that referenced this issue Feb 13, 2025
@javier-godoy javier-godoy linked a pull request Feb 13, 2025 that will close this issue
javier-godoy added a commit that referenced this issue Feb 13, 2025
javier-godoy added a commit that referenced this issue Feb 18, 2025
@javier-godoy javier-godoy moved this from Inbox (needs triage) to In Progress in Flowing Code Addons Mar 10, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

1 participant