Closed celso-alexandre closed 4 months ago
2.3.6 is broken with image opt, you can downgrade to 2.3.5 or set SHARP_VERSION="0.32.6"
env variable before running open-next build
.
Someone has reported an issue with 0.32.6 as well but i haven't had time to reproduce the issue yet and it seems that most people are managing to make it work with 0.32.6.
That's the PR for 2.3.6, there is more info here : https://github.com/sst/open-next/pull/361
Thanks for replying, and I must say I'm very much amused by this piece of software, and I've learned a lot from it. I've updated the description with my current serverless.yml definition.
I should add that after downgrading sharp to 0.32.6 and setting the variable as building SHARP_VERSION="0.32.6" yarn open-next build --minify
, the lambda function "image-optimization-function" still produces an import of the inexistent file "./threadChild.js".
I will soon report back if the error persists
What next version are you currently on? sharp
said https://github.com/vercel/next.js/releases/tag/v14.1.1-canary.28 fixed some things regards to it; can you try installing the latest 14.1.1 canary to see if it does indeed fix the problem?
Thanks for helping. I can confirm after a couple tests that this exact line is not called anymore by changing the sharp version to 0.32.6. Many thanks
open-next version: 2.3.6 System: Linux Mint Linux 5.15.0-88-generic #98-Ubuntu SMP Mon Oct 2 15:18:56 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Deploy: I'm using serverless CLI. I may be missing something, maybe SST would've add the missing file before zipping it
My full serverless.yml: https://github.com/sst/open-next/issues/32#issuecomment-1973330303
Description: It seems that the generated "image-optimization" lambda is trying to import the file __dirname,"./threadChild.js", which was not generated
This is the cloudwatch log error I'm getting:
The following were produced by
![image](https://github.com/sst/open-next/assets/37484505/57e5b949-01c6-49d2-87aa-64da3db302d0)
yarn open-next build
open-next version: 2.3.6