We’ve been using growthbook for a few minutes with...
# ask-questions
f
We’ve been using growthbook for a few minutes with the client side SDK, but we’re looking to swap over to lambda edge. I’ve been trying to get it working but not having much luck. I’ve confirmed a basic lambda function is configured w/ our cloudfront, but once I add the growthbook specific handler, I run into errors. When I deploy the lambda version that uses growthbook, I’m seeing logs with this error:
Copy code
2025-11-18T15:22:00.113Z	a762f8a1-1df6-4c0b-98aa-686ec37e6ff8	ERROR	Unhandled Promise Rejection 	
{
    "errorType": "Runtime.UnhandledPromiseRejection",
    "errorMessage": "TypeError: Invalid URL",
    "reason": {
        "errorType": "TypeError",
        "errorMessage": "Invalid URL",
        "code": "ERR_INVALID_URL",
        "input": "undefined",
        "stack": [
            "TypeError: Invalid URL",
            "    at new URL (node:internal/url:825:25)",
            "    at Ms (/var/task/index.js:31:69858)",
            "    at Object.w3 [as proxyRequest] (/var/task/index.js:31:75389)",
            "    at /var/task/index.js:31:65455",
            "    at Generator.next (<anonymous>)",
            "    at s (/var/task/index.js:31:64093)"
        ]
    },
    "promise": {},
    "stack": [
        "Runtime.UnhandledPromiseRejection: TypeError: Invalid URL",
        "    at process.<anonymous> (file:///var/runtime/index.mjs:1448:17)",
        "    at process.emit (node:events:519:28)",
        "    at emitUnhandledRejection (node:internal/process/promises:252:13)",
        "    at throwUnhandledRejectionsMode (node:internal/process/promises:388:19)",
        "    at processPromiseRejections (node:internal/process/promises:475:17)",
        "    at process.processTicksAndRejections (node:internal/process/task_queues:106:32)"
    ]
}
Nothing is growthbook specific in those logs, but I’m guessing it’s coming from something growthbook is doing. A couple of questions: 1. PROXY_TARGET — I’m pointing this to our S3 bucket that serves the website, which is
http
, not
https
— is that okay? If I use https, that’d point back to a cloudfront distro URL and I think it’d go into some kind of infinite redirect loop 2. Is there a way to test this w/o having to redeploy my cloudfront distro and wait for the website to break
When a send a test event within aws, I get a 3 second timeout and it’s definitely coming from the growthbook call, which I verified with logs. But when I deploy it, that’s why I see the aforementioned stacktrace.
Still fighting w/ this. It seems timeout + memory related. When growthbook is running on the lambda, it’s insanely slow. 4-6 seconds. When I tried forcing variants, the lambda blows up. Is this whole growthbook edge stuff buggy? Or is something weird w/ my situation that’s causing all these headahces?
s
Hey Nate! Did you make any progress here?
f
I talked to someone at growthbook on the web chat and I don’t think the edge SDK will work for us, so went back to the client side sdk
s
Gotcha! What was the reason?
f
It’s too slow and the memory limitations on aws edge functions makes it even worse.
I was able to get it working locally b/c it was instant. But on an edge requests were ~4-5 seconds
s
oh, shoot.
f
I guess we’d have to do some caching w/ a key/value store
We’re not heavy growthbook users, so i guess the client side solution can get us by
1