Chris
Chris
CDCloudflare Developers
Created by Chris on 6/1/2024 in #workers-help
Rate Limiting not working in environments
Hi I have a rate limiter defined on my dev env as such:
[[env.dev.unsafe.bindings]]
name = "RATE_LIMITER"
type = "ratelimit"
namespace_id = "1001"
simple = { limit = 20, period = 10 }
[[env.dev.unsafe.bindings]]
name = "RATE_LIMITER"
type = "ratelimit"
namespace_id = "1001"
simple = { limit = 20, period = 10 }
When the worker executes, there isn't a limit function bound for me to call. A console log of the environment shows:
"RATE_LIMITER": {},
"RATE_LIMITER": {},
And if I try to run the limit:
TypeError: Illegal invocation\n at Object.limit (main.js:25902:38)\n
TypeError: Illegal invocation\n at Object.limit (main.js:25902:38)\n
2 replies