Skip to content

bug: commandkit/ratelimit throws ReferenceError: RateLimitStorage is not defined on import (v1.2.0) #615

@dec1belPP

Description

@dec1belPP

When importing createRateLimiter from commandkit/ratelimit, CommandKit throws a ReferenceError: RateLimitStorage is not defined before my command can even load. This makes the documented commandkit/ratelimit entrypoint unusable.

Looking at node_modules/commandkit/ratelimit.cjs, it tries to export RateLimitStorage, but that symbol is never defined in the required module (./dist/utils/useful-stuff/ratelimiter.js), which only exports RateLimiter, MemoryRateLimitStorage, etc.

Here's the full stack trace:

✔ Loaded .env
 [INFO]    │ 01:09:50.289 └ CommandKit CachePlugin has been activated!
 [INFO]    │ 01:09:50.302 └ ✨ Loaded event clientReady with 1 listener
 [INFO]    │ 01:09:50.302 └ 🔌 Registered event clientReady (1 sequential, 0 parallel, 0 once-sequential, 0 once-parallel)
 [ERROR]    │ 01:09:50.309 └ Failed to load command verify (04112010-242c-4639-88b8-705085ae1c8a): RateLimitStorage is not defined
ReferenceError: RateLimitStorage is not defined
    at Object.<anonymous> (...\node_modules\.pnpm\commandkit@1.2.0_typescript@5.9.3\node_modules\commandkit\ratelimit.cjs:21:3)
    at Module._compile (node:internal/modules/cjs/loader:1812:14)
    at Object..js (node:internal/modules/cjs/loader:1943:10)
    at Module.load (node:internal/modules/cjs/loader:1533:32)
    at Module._load (node:internal/modules/cjs/loader:1335:12)
    at wrapModuleLoad (node:internal/modules/cjs/loader:255:19)
    at loadCJSModuleWithModuleLoad (node:internal/modules/esm/translators:328:3)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:233:7)
    at ModuleJob.run (node:internal/modules/esm/module_job:430:25)
    at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:661:26)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions