Skip to content

Bug / Typo: 2nd deviceSizes should be imageSizes #53

@danielgriese

Description

@danielgriese

Hey!

First off great work and thanks for sharing your solution!
I used your setup as a reference to get the same thing running via serverless framework.

Whilst testing I encountered the issue that I was not able to generate images smaller than w=640, it would say "w" parameter (width) of 256 is not allowed even though it is a valid default imageSize.

Looking at the code I found the cause. Here, when using the defaults in case of missing envs, the second default should be imageSizes and not deviceSizes again.
https://github.com/dealmore/terraform-aws-next-js-image-optimization/blob/4de6dfb3b241d3a6d99d603e8b047cddaf1937cf/lib/handler.ts#L61

Just wanted to let you know in case anyone is using this without explicit envs and encounters this as well.
Thanks and kind regards,
Daniel

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions