diff --git a/.changeset/little-lobsters-decide.md b/.changeset/little-lobsters-decide.md new file mode 100644 index 00000000000..d8963bc7847 --- /dev/null +++ b/.changeset/little-lobsters-decide.md @@ -0,0 +1,6 @@ +--- +"remix": patch +"@remix-run/dev": patch +--- + +don't allow `*` to be anywhere in flat route segment diff --git a/packages/remix-dev/__tests__/flat-routes-test.ts b/packages/remix-dev/__tests__/flat-routes-test.ts index 5b9bb523a85..989e7dd3a21 100644 --- a/packages/remix-dev/__tests__/flat-routes-test.ts +++ b/packages/remix-dev/__tests__/flat-routes-test.ts @@ -109,6 +109,7 @@ describe("flatRoutes", () => { let invalidSplatFiles: string[] = [ "routes/about.[*].tsx", "routes/about.*.tsx", + "routes/about.[.[.*].].tsx", ]; for (let invalid of invalidSplatFiles) { @@ -369,14 +370,6 @@ describe("flatRoutes", () => { path: ".", }, ], - [ - "routes/about.[.[.*].].tsx", - { - id: "routes/about.[.[.*].]", - parentId: "routes/about", - path: ".[.*/]", - }, - ], // Optional route segments [ diff --git a/packages/remix-dev/config/flat-routes.ts b/packages/remix-dev/config/flat-routes.ts index c0b83821d43..7312d3c6624 100644 --- a/packages/remix-dev/config/flat-routes.ts +++ b/packages/remix-dev/config/flat-routes.ts @@ -133,7 +133,7 @@ export function getRouteSegments(routeId: string) { ); }; - if (rawRouteSegment === "*") { + if (rawRouteSegment.includes("*")) { return notSupportedInRR(rawRouteSegment, "*"); }