Registry / web-framework / vite-plugin-react-fallback-throttle

vite-plugin-react-fallback-throttle

JSON →
library0.1.3jsnpmunverified

Vite plugin that configures FALLBACK_THROTTLE_MS in React 19 to control the delay before showing a Suspense fallback. Current stable version is 0.1.3, released with OIDC trusted publishing and immutable releases for supply chain security. Supports Vite 2.3+ up to 8, and Vitest Browser Mode. It resolves a common React 19 Suspense issue where reducing the throttle delay improves UX by showing fallbacks faster during navigation. Ships TypeScript types. Unlike manual configuration, this plugin handles environment detection and pre-bundled dependency patching automatically.

npm install vite-plugin-react-fallback-throttle
INSTALL
IMPORT
SIG · VITE-PLUGIN-REACT-
V
vite-plugin-react-fallback-throttle
web-frameworkjavascriptv0.1.3
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18–223 runs
build_error
glibc
node 18–223 runs
build_error
Code
Verified usage

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

reactFallbackThrottle
✓ import reactFallbackThrottle from 'vite-plugin-react-fallback-throttle'
✗ const reactFallbackThrottle = require('vite-plugin-react-fallback-throttle')
ESM-only package; does not support CommonJS require. The default export is a function.
ReactFallbackThrottleOptions
✓ import type { ReactFallbackThrottleOptions } from 'vite-plugin-react-fallback-throttle'
✗ import { ReactFallbackThrottleOptions } from 'vite-plugin-react-fallback-throttle'
Options type is only available as a type import; value import will fail at runtime.
Plugin
✓ import reactFallbackThrottle from 'vite-plugin-react-fallback-throttle'
✗ import { vitePluginReactFallbackThrottle } from 'vite-plugin-react-fallback-throttle'
The default export is the Vite plugin function; there is no named export for it.

Shows how to add the plugin to a Vite config with React 19 and a custom throttle delay of 200ms.

import { defineConfig } from 'vite'; import react from '@vitejs/plugin-react'; import reactFallbackThrottle from 'vite-plugin-react-fallback-throttle'; export default defineConfig({ plugins: [ react(), reactFallbackThrottle({ throttleMs: 200 }), ], });
Debug
Known issues
gotchaThe plugin only works with React 19 (react-dom ^19.0.0). Using it with older React versions will have no effect.
fix
Ensure your project uses react-dom@^19.0.0.
affects: <0.1.0 || >=0.1.0
gotchaThe default export is a function that returns a Vite plugin object, not the plugin object itself. Forgetting to call it with options will cause an error.
fix
Always invoke the imported function: reactFallbackThrottle({ throttleMs: 300 }).
affects: >=0.1.0
breakingIn v0.1.0, the plugin could not correctly handle pre-bundled React DOM dependencies. This was fixed in v0.1.1.
fix
Upgrade to v0.1.1 or later.
affects: 0.1.0
gotchaThe plugin does not support CommonJS require(); it is ESM-only. Using require() will fail at runtime.
fix
Use dynamic import() or switch to ESM.
affects: >=0.1.0
Errors
Common errors & fixes
Error: The plugin react-fallback-throttle requires a function export, but got an object.
Using import reactFallbackThrottle from ... incorrectly as a plugin object without invoking the function.
fix
Call the imported function: reactFallbackThrottle({ throttleMs: 300 }).
TypeError: reactFallbackThrottle is not a function
Trying to use CommonJS require() on an ESM-only package.
fix
Use import reactFallbackThrottle from 'vite-plugin-react-fallback-throttle'.
Vite: The plugin 'react-fallback-throttle' is not supported by your version of Vite.
Using a Vite version outside the supported range (>=2.3.0 <9.0.0).
fix
Update Vite to a compatible version: npm install vite@6.
Upgrade
Version history
0.1.3latest on npm
Audit
Dependencies
react-domrequiredThe plugin patches FALLBACK_THROTTLE_MS in react-dom's internal configuration; only works with React 19.
viterequiredVite plugin architecture requirement; must be version 2.3.0 or later.
Agent activity
30 hits · last 30 days
node
26
OpenAI (training)
1
Resources
vite-plugin-react-fallback-throttle — npm install vite-plugin-react-fallback-throttle · libregistry