Registry / devops / next-plugin-query-cache

next-plugin-query-cache

JSON →
library2.0.1jsnpmunverified

A build-time query cache for Next.js to cache data fetching results at build time, reducing runtime API calls and improving performance for statically generated pages. Version 2.0.1 released in March 2021; no active development since then (last commit July 2020). Supports Next.js ^10.0.9. Ships TypeScript types. Alternative to static generation with ISR or SWR, but focused on build-time caching.

npm install next-plugin-query-cache
INSTALL
IMPORT
SIG · NEXT-PLUGIN-QUERY-
N
next-plugin-query-cache
devopsjavascriptv2.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

withQueryCache
import { withQueryCache } from 'next-plugin-query-cache'
const withQueryCache = require('next-plugin-query-cache');
ESM-only; CommonJS require will fail.
QueryCachePlugin
import { QueryCachePlugin } from 'next-plugin-query-cache'
Advanced usage for custom Webpack configuration.

Shows how to enable the plugin in next.config.js using CommonJS require.

// next.config.js const { withQueryCache } = require('next-plugin-query-cache'); module.exports = withQueryCache({ // Next.js config });
Debug
Known issues
deprecatedPackage is deprecated; no updates since July 2020.
fix
Consider using SWR or React Query for client-side caching, or Incremental Static Regeneration (ISR) for build-time caching.
affects: >=2.0.0
gotchaWorks only with Next.js 10.0.9 and above; incompatible with newer versions.
fix
Check compatibility; may require forking or updating peer dependency.
affects: >=2.0.0
gotchaPlugin caches queries at build time; dynamic queries will not be cached.
fix
Use only for static pages; for dynamic data, use client-side caching.
affects: >=2.0.0
Errors
Common errors & fixes
Cannot find module 'next-plugin-query-cache'
Package not installed or not in node_modules.
fix
Run npm install next-plugin-query-cache
TypeError: withQueryCache is not a function
Incorrect import method (CommonJS vs ESM).
fix
Use const { withQueryCache } = require('next-plugin-query-cache') in next.config.js
Error: 'next' is not a valid peer dependency
Next.js version mismatch.
fix
Ensure Next.js version >=10.0.9 and <=11.0.0
Upgrade
Version history
2.0.1latest on npm
Audit
Dependencies
nextrequiredPeer dependency for Next.js integration
Agent activity
2 hits · last 30 days
node
2
Resources
next-plugin-query-cache — npm install next-plugin-query-cache · libregistry