{"id":22800,"library":"vite-plugin-react-fallback-throttle","title":"Vite Plugin React Fallback Throttle","description":"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.","status":"active","version":"0.1.3","language":"javascript","source_language":"en","source_url":"https://github.com/wojtekmaj/vite-plugin-react-fallback-throttle","tags":["javascript","vite","vite-plugin","plugin","react","suspense","typescript"],"install":[{"cmd":"npm install vite-plugin-react-fallback-throttle","lang":"bash","label":"npm"},{"cmd":"yarn add vite-plugin-react-fallback-throttle","lang":"bash","label":"yarn"},{"cmd":"pnpm add vite-plugin-react-fallback-throttle","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"The plugin patches FALLBACK_THROTTLE_MS in react-dom's internal configuration; only works with React 19.","package":"react-dom","optional":false},{"reason":"Vite plugin architecture requirement; must be version 2.3.0 or later.","package":"vite","optional":false}],"imports":[{"note":"ESM-only package; does not support CommonJS require. The default export is a function.","wrong":"const reactFallbackThrottle = require('vite-plugin-react-fallback-throttle')","symbol":"reactFallbackThrottle","correct":"import reactFallbackThrottle from 'vite-plugin-react-fallback-throttle'"},{"note":"Options type is only available as a type import; value import will fail at runtime.","wrong":"import { ReactFallbackThrottleOptions } from 'vite-plugin-react-fallback-throttle'","symbol":"ReactFallbackThrottleOptions","correct":"import type { ReactFallbackThrottleOptions } from 'vite-plugin-react-fallback-throttle'"},{"note":"The default export is the Vite plugin function; there is no named export for it.","wrong":"import { vitePluginReactFallbackThrottle } from 'vite-plugin-react-fallback-throttle'","symbol":"Plugin","correct":"import reactFallbackThrottle from 'vite-plugin-react-fallback-throttle'"}],"quickstart":{"code":"import { defineConfig } from 'vite';\nimport react from '@vitejs/plugin-react';\nimport reactFallbackThrottle from 'vite-plugin-react-fallback-throttle';\n\nexport default defineConfig({\n  plugins: [\n    react(),\n    reactFallbackThrottle({ throttleMs: 200 }),\n  ],\n});","lang":"typescript","description":"Shows how to add the plugin to a Vite config with React 19 and a custom throttle delay of 200ms."},"warnings":[{"fix":"Ensure your project uses react-dom@^19.0.0.","message":"The plugin only works with React 19 (react-dom ^19.0.0). Using it with older React versions will have no effect.","severity":"gotcha","affected_versions":"<0.1.0 || >=0.1.0"},{"fix":"Always invoke the imported function: reactFallbackThrottle({ throttleMs: 300 }).","message":"The 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.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Upgrade to v0.1.1 or later.","message":"In v0.1.0, the plugin could not correctly handle pre-bundled React DOM dependencies. This was fixed in v0.1.1.","severity":"breaking","affected_versions":"0.1.0"},{"fix":"Use dynamic import() or switch to ESM.","message":"The plugin does not support CommonJS require(); it is ESM-only. Using require() will fail at runtime.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Call the imported function: reactFallbackThrottle({ throttleMs: 300 }).","cause":"Using import reactFallbackThrottle from ... incorrectly as a plugin object without invoking the function.","error":"Error: The plugin react-fallback-throttle requires a function export, but got an object."},{"fix":"Use import reactFallbackThrottle from 'vite-plugin-react-fallback-throttle'.","cause":"Trying to use CommonJS require() on an ESM-only package.","error":"TypeError: reactFallbackThrottle is not a function"},{"fix":"Update Vite to a compatible version: npm install vite@6.","cause":"Using a Vite version outside the supported range (>=2.3.0 <9.0.0).","error":"Vite: The plugin 'react-fallback-throttle' is not supported by your version of Vite."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}