Skip to content

Commit

Permalink
Fixes a bug in how injectRoute parses route patterns on Windows (wi…
Browse files Browse the repository at this point in the history
…thastro#3763)

* always remove a leading slash in the `injectRoute` pattern

* chore: add changeset
  • Loading branch information
Tony Sullivan authored Jun 29, 2022
1 parent 849228d commit c4cf5e7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/routing/manifest/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import path from 'path';
import slash from 'slash';
import { fileURLToPath } from 'url';
import { warn } from '../../logger/core.js';
import { removeLeadingForwardSlash } from '../../path.js';
import { resolvePages } from '../../util.js';
import { getRouteGenerator } from './generator.js';
const require = createRequire(import.meta.url);
Expand Down Expand Up @@ -294,7 +295,7 @@ export function createRouteManifest(
const isDynamic = (str: string) => str?.[0] === '[';
const normalize = (str: string) => str?.substring(1, str?.length - 1);

const segments = name
const segments = removeLeadingForwardSlash(name)
.split(path.sep)
.filter(Boolean)
.map((s: string) => {
Expand Down

0 comments on commit c4cf5e7

Please sign in to comment.