Open sladkoff opened 2 months ago
Is this happening with emotion
, or with minify: true
in general?
Is this happening with
emotion
, or withminify: true
in general?
I can not give you much more information as I only have that single project to test with at the moment and it's using emotion
.
When minify=true
, I get the error. When minify=false
I don't get the error.
Does this work on Vercel? At this point, you should turn minify off - you'll probably benefit more from removing the dev dependencies. Although, I think we already minify here: https://github.com/sst/open-next/blob/main/packages/open-next/src/build/bundleNextServer.ts#L57
bundleNextServer
is only used if you set experimentalBundledNextServer
in your OpenNext config (which is a deprecated option that we should probably remove in 3.2)
As khuezy said you should first check if you have any dev dependencies bundled (https://open-next.js.org/common_issues#reducing-bundle-size ) and/or you could use function splitting https://open-next.js.org/config/simple_example#splitting-the-server
I'm not sure what we should do with this minify
option. It was very useful when we didn't have function splitting and ISR/SSG pages were bundled as well. Nowadays i'm not sure it provides that much benefit ( Ideally we should run some benchmark to properly test this ).
Does this work on Vercel? At this point, you should turn minify off - you'll probably benefit more from removing the dev dependencies. Although, I think we already minify here: https://github.com/sst/open-next/blob/main/packages/open-next/src/build/bundleNextServer.ts#L57
Sorry, I don't know if this works on Vercel and can't test this right now. I'll try to play around with the dev-dependencies. Thank you for the advice.
Problem
I tried minification in my open-next.config.ts which seems to be "experimental" according to the documentation:
I deployed my app and started testing. At first glance everything seemed to work. Some pages (not all) threw internal server errors.
I inspected the server function lambda logs which included this error for the invocations that seemed to result in the error pages:
Notable dependency versions:
Workaround
I disabled the
minify
option and redeployed the app. The pages that were previously broken work with no issues.