Error: Dynamic require of \"node:buffer\" is not supported

I added amazon SES to my SvelteKit pages application and it deploys perfectly fine, but when visiting the deployment URL it throws a 500 internal error. The logs return this message: Error: Dynamic require of \"node:buffer\" is not supported I have the nodejs_compat flag already added
1 Reply
x03
x03OP9mo ago
import SES from "aws-sdk/clients/ses"

return new SES({
region: "aws-global",
credentials: {
accessKeyId: env.AWS_ACCESS_KEY_ID,
secretAccessKey: env.AWS_SECRET_ACCESS_KEY,
},
})
.sendEmail(options)
.promise()
import SES from "aws-sdk/clients/ses"

return new SES({
region: "aws-global",
credentials: {
accessKeyId: env.AWS_ACCESS_KEY_ID,
secretAccessKey: env.AWS_SECRET_ACCESS_KEY,
},
})
.sendEmail(options)
.promise()
The SDK code in a nutshell
Want results from more Discord servers?
Add your server