-
Notifications
You must be signed in to change notification settings - Fork 950
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
Increase memory for server function on Next.js with image optimization #7940
base: master
Are you sure you want to change the base?
Conversation
src/frameworks/index.ts
Outdated
if (frameworksBackend && framework === "next") { | ||
if (await isUsingImageOptimization(getProjectPath(), ".next")) { | ||
frameworksBackend.memory = "512MiB"; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of doing it here, I’d move this to the Next.js files and return frameworksBackend
overrides from ɵcodegenFunctionsDirectory
, @jamesdaniels WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I refactored this to do it in the Next.js file.
src/frameworks/index.ts
Outdated
@@ -538,6 +539,12 @@ ${ | |||
|
|||
// TODO move to templates | |||
|
|||
if (frameworksBackend && framework === "next") { | |||
if (await isUsingImageOptimization(getProjectPath(), ".next")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't we need to do this only for Next 15?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The memory issue is happening on Next 14 and 13 as well 🫠
...functionsDirectoryFrameworksBackend, | ||
...frameworksBackend, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think functionsDirectoryFrameworksBackend
should come after so it can override the default values?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm thinking that the user could set the memory to a higher value, in that case we should not override it.
Description
Scenarios Tested
Sample Commands