Skip to content

Commit

Permalink
Fix article hydration bug
Browse files Browse the repository at this point in the history
  • Loading branch information
shiro committed Jun 11, 2024
1 parent 0cb133a commit cb9ea84
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export default defineConfig({
port: 3000,
warmup: { clientFiles: ["./src/app.tsx"] },
},
build: { sourcemap: true },
resolve: {
alias: Object.fromEntries(
Object.entries(tsconfig.compilerOptions.paths).map(([key, value]) => [
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"dev": "vinxi dev",
"build": "vinxi build",
"start": "vinxi start",
"serve": "cd .output && npx http-server public -p 3000",
"version": "vinxi version"
},
"dependencies": {
Expand Down
3 changes: 2 additions & 1 deletion src/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ export const routes: RouteDefinition[] = [
path: "/articles/:name",
component: (p) => {
// router bug: 'name' not in 'p', update when this is fixed
const name = p.location.pathname.replace(`${config.base}/articles/`, "");
let name = p.location.pathname.replace(`${config.base}/articles/`, "");
if (name.endsWith("/")) name = name.slice(0, -1);
return (
<div class="mb-16">
<Article name={name} />
Expand Down

0 comments on commit cb9ea84

Please sign in to comment.