Skip to content

Commit cb9ea84

Browse files
committed
Fix article hydration bug
1 parent 0cb133a commit cb9ea84

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

app.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export default defineConfig({
4343
port: 3000,
4444
warmup: { clientFiles: ["./src/app.tsx"] },
4545
},
46+
build: { sourcemap: true },
4647
resolve: {
4748
alias: Object.fromEntries(
4849
Object.entries(tsconfig.compilerOptions.paths).map(([key, value]) => [

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"dev": "vinxi dev",
77
"build": "vinxi build",
88
"start": "vinxi start",
9+
"serve": "cd .output && npx http-server public -p 3000",
910
"version": "vinxi version"
1011
},
1112
"dependencies": {

src/routes.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ export const routes: RouteDefinition[] = [
1111
path: "/articles/:name",
1212
component: (p) => {
1313
// router bug: 'name' not in 'p', update when this is fixed
14-
const name = p.location.pathname.replace(`${config.base}/articles/`, "");
14+
let name = p.location.pathname.replace(`${config.base}/articles/`, "");
15+
if (name.endsWith("/")) name = name.slice(0, -1);
1516
return (
1617
<div class="mb-16">
1718
<Article name={name} />

0 commit comments

Comments
 (0)