code-forge-io / code-forge-io/seo-tools

Support `virtual:react-router/server-build` for usage with React Router 7

Open
#13 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
94
Forks
9
PR merge metrics
No merged PRs in 30d

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:

```ts
build: {
rollupOptions: {
external: ['virtual:remix/server-build'],
}
}
```

Thanks for maintaining this package — would appreciate support for React Router 7!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.