{"id":22806,"library":"vite-plugin-react-router-amplify-hosting","title":"vite-plugin-react-router-amplify-hosting","description":"Vite plugin for deploying React Router SSR applications to AWS Amplify Hosting. Current version 0.7.0 (supports Vite 5/6/7/8, React Router v7, Node >=20). Generates deploy-manifest.json, bundles a server.mjs entry point, and produces the correct folder structure for Amplify deployment. Requires manual installation of express, compression, morgan, isbot, and @react-router/express. Alternative to Amplify's built-in SSR support with tighter React Router integration.","status":"active","version":"0.7.0","language":"javascript","source_language":"en","source_url":"https://github.com/fossamagna/react-router-amplify","tags":["javascript","amplify","react-router","vite-plugin","typescript"],"install":[{"cmd":"npm install vite-plugin-react-router-amplify-hosting","lang":"bash","label":"npm"},{"cmd":"yarn add vite-plugin-react-router-amplify-hosting","lang":"bash","label":"yarn"},{"cmd":"pnpm add vite-plugin-react-router-amplify-hosting","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency","package":"@react-router/dev","optional":false},{"reason":"peer dependency","package":"vite","optional":false},{"reason":"required for SSR server","package":"express","optional":false},{"reason":"required for server bundle","package":"compression","optional":false},{"reason":"required for server bundle","package":"morgan","optional":false},{"reason":"required for server bundle","package":"@react-router/express","optional":false},{"reason":"required for server bundle","package":"isbot","optional":true}],"imports":[{"note":"Named export only. Default import will not work.","wrong":"import amplifyHosting from 'vite-plugin-react-router-amplify-hosting'","symbol":"amplifyHosting","correct":"import { amplifyHosting } from 'vite-plugin-react-router-amplify-hosting'"},{"note":"TypeScript type export, cannot be used as runtime value.","wrong":"import { AmplifyHostingOptions } from 'vite-plugin-react-router-amplify-hosting'","symbol":"AmplifyHostingOptions","correct":"import type { AmplifyHostingOptions } from 'vite-plugin-react-router-amplify-hosting'"},{"note":"TypeScript type export, cannot be used as runtime value.","wrong":"import { AmplifyHostingConfig } from 'vite-plugin-react-router-amplify-hosting'","symbol":"AmplifyHostingConfig","correct":"import type { AmplifyHostingConfig } from 'vite-plugin-react-router-amplify-hosting'"}],"quickstart":{"code":"// vite.config.ts\nimport { defineConfig } from 'vite';\nimport { reactRouter } from '@react-router/dev/vite';\nimport { amplifyHosting } from 'vite-plugin-react-router-amplify-hosting';\n\nexport default defineConfig({\n  plugins: [\n    reactRouter(),\n    amplifyHosting({\n      computeResources: 'serverless',\n    }),\n  ],\n});","lang":"typescript","description":"Minimal Vite config adding the amplify plugin for React Router SSR on Amplify Hosting."},"warnings":[{"fix":"Upgrade Node to v20 or use nvm in CI: nvm install 20 && nvm use 20","message":"Requires Node.js v20 or later. Older Node versions cause build failures.","severity":"breaking","affected_versions":"<20.0.0"},{"fix":"Set artifacts.baseDirectory: .amplify-hosting in amplify.yml","message":"Plugin generates non-standard deploy structure; artifacts.baseDirectory must be .amplify-hosting.","severity":"breaking","affected_versions":">=0.1.0"},{"fix":"Remove unstable_viteEnvironmentApi flag; use stable configuration.","message":"The unstable_viteEnvironmentApi flag has been experimental in some versions; prefer stable API.","severity":"deprecated","affected_versions":">=0.2.0 <0.5.0"},{"fix":"npm add -D compression express isbot morgan @react-router/express","message":"Missing server dependencies (express, compression, morgan, isbot, @react-router/express) cause SSR build failures.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Upgrade to vite-plugin-react-router-amplify-hosting@0.7.0","message":"Vite 8 support added in 0.7.0; older versions break with Vite 8.","severity":"gotcha","affected_versions":"<0.7.0"}],"env_vars":null,"search_vec":"'/express':59 '0.7.0':22 '20':30 '5/6/7/8':25 'altern':60 'amplifi':6,18,45,62,75 'applic':15 'aw':17 'built':65 'built-in':64 'bundl':33 'compress':52 'correct':41 'current':20 'deploy':11,46 'deploy-manifest.json':32 'entri':36 'express':51 'folder':42 'generat':31 'host':7,19 'instal':49 'integr':73 'isbot':54 'javascript':74 'manual':48 'morgan':53 'node':29 'plugin':3,9,81 'point':37 'produc':39 'react':4,12,26,57,71,77 'react-rout':56,76 'requir':47 'router':5,13,27,58,72,78 'server.mjs':35 'ssr':14,67 'structur':43 'support':23,68 'tighter':70 'typescript':82 'v7':28 'version':21 'vite':2,8,24,80 'vite-plugin':79 'vite-plugin-react-router-amplify-host':1","created_at":"2026-04-27T17:07:07.176625+00:00","updated_at":"2026-04-27T17:07:07.176625+00:00","problems":[{"fix":"npm install express compression morgan @react-router/express","cause":"Missing required runtime dependencies for the server bundle.","error":"Cannot find module 'express' or '@react-router/express'"},{"fix":"Use nvm install 20 && nvm use 20 in preBuild phase of amplify.yml","cause":"Plugin requires Node.js v20 or later due to engine constraints.","error":"Error: Node version (18.x) is not supported. Expected Node.js >=20.0.0"},{"fix":"Set artifacts.baseDirectory: .amplify-hosting in amplify.yml","cause":"Amplify build settings must point to the output directory generated by this plugin.","error":"The 'baseDirectory' should be '.amplify-hosting' but is '.next' or other"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/fossamagna/react-router-amplify","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/vite-plugin-react-router-amplify-hosting","openapi_spec":null,"status_page":null,"smithery":null,"categories":["aws","web-framework","devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-18","next_check":"2026-07-26","install_tag":null}}