Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/cool-pillows-sing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"react-router": patch
---

Skip resource route flow in dev server in SPA mode
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { createRequestHandler } from "../../lib/server-runtime/server";
describe("createRequestHandler", () => {
it("retains request headers when stripping body off for loaders", async () => {
let handler = createRequestHandler({
ssr: true,
routes: {
root: {
id: "routes/test",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ function spyConsole() {
describe.skip("server", () => {
let routeId = "root";
let build: ServerBuild = {
ssr: true,
entry: {
module: {
default: async (request) => {
Expand Down
1 change: 1 addition & 0 deletions packages/react-router/__tests__/server-runtime/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export function mockServerBuild(
} = {}
) {
return {
ssr: true,
future: {
...opts.future,
},
Expand Down
1 change: 1 addition & 0 deletions packages/react-router/lib/server-runtime/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ export const createRequestHandler: CreateRequestHandlerFunction = (
}
}
} else if (
!request.headers.has("X-React-Router-SPA-Mode") &&
matches &&
matches[matches.length - 1].route.module.default == null &&
matches[matches.length - 1].route.module.ErrorBoundary == null
Expand Down