-
Notifications
You must be signed in to change notification settings - Fork 8
Support virtual:react-router/server-build for usage with React Router 7 #13
Description
When using React Router 7, the Vite virtual module virtual:remix/server-build has been renamed to virtual:react-router/server-build.
Currently, @forge42/seo-tools imports virtual:remix/server-build, which causes the Vite build to fail with Rollup resolution errors when used in a RR7 project. Here is an example when I tried to build via Vercel:
[vite]: Rollup failed to resolve import "virtual:remix/server-build" from /vercel/path0/node_modules/.pnpm/@Forge42+seo-tools@1.4.2_typescript@5.8.3/node_modules/@forge42/seo-tools/dist/remix/sitemap.mjs".
To support the React Router 7 architecture, this import path should be updated or made compatible with both versions.
Temporary workaround:
Add the following to vite.config.ts to unblock builds:
build: {
rollupOptions: {
external: ['virtual:remix/server-build'],
}
}Thanks for maintaining this package — would appreciate support for React Router 7!