#Could not resolve "convex-helpers/server/pagination"
4 messages · Page 1 of 1 (latest)
Hi @astral agate. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
The error "Could not resolve 'convex-helpers/server/pagination'" typically means that your project cannot find the module at that path. According to the knowledge sources, the correct way to use the pagination helpers from the convex-helpers package is to first ensure you have installed the convex-helpers npm package:
npm install convex-helpers
Then, you should import getPage like this:
import { getPage } from "convex-helpers/server/pagination";
If you are still seeing the error after installing, it could be due to one of the following reasons:
-
Incorrect Package Version: Make sure you have the latest version of convex-helpers installed, as older versions may not have the
server/paginationexport. You can update it with:npm install convex-helpers@latest -
Module Resolution Issues: Your TypeScript or bundler configuration might not be set up to resolve the package correctly. For example, ensure your
tsconfig.jsonhas appropriate settings formoduleResolution(e.g., "bundler") andmodule(e.g., "esnext") as seen in community discussions. This has resolved similar issues for others:{ "compilerOptions": { "moduleResolution": "bundler", "module": "esnext", // ...other options } } -
Package Installation: Double-check that
node_modules/convex-helpers/server/pagination.js(or.ts) actually exists after installation. If not, the package version may not include it.
There is no mention in the knowledge sources of another official Convex pagination package you should use instead. The recommended approach is to use convex-helpers for advanced pagination patterns, as described in the Stack Convex documentation Take Control of Pagination.
If you continue to have issues, ensure your package manager lockfile is up to date (delete node_modules and your lockfile, then reinstall), and verify your import path matches the package structure.