Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ssg): fixed isDynamicRoute and ssgParams matter #2006

Merged
merged 2 commits into from
Jan 17, 2024
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion deno_dist/helper/ssg/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,15 @@ export const fetchRoutesContent = async <
const baseURL = 'http://localhost'

for (const route of inspectRoutes(app)) {
if (route.isMiddleware || isDynamicRoute(route.path)) continue
if (route.isMiddleware) continue

// GET Route Info
const thisRouteBaseURL = new URL(route.path, baseURL).toString()
const forGetInfoURLRequest = new Request(thisRouteBaseURL) as AddedSSGDataRequest
await app.fetch(forGetInfoURLRequest)

if (!forGetInfoURLRequest.ssgParams) {
if (isDynamicRoute(route.path)) continue
forGetInfoURLRequest.ssgParams = [{}]
}

Expand Down
3 changes: 2 additions & 1 deletion src/helper/ssg/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,15 @@ export const fetchRoutesContent = async <
const baseURL = 'http://localhost'

for (const route of inspectRoutes(app)) {
if (route.isMiddleware || isDynamicRoute(route.path)) continue
if (route.isMiddleware) continue

// GET Route Info
const thisRouteBaseURL = new URL(route.path, baseURL).toString()
const forGetInfoURLRequest = new Request(thisRouteBaseURL) as AddedSSGDataRequest
await app.fetch(forGetInfoURLRequest)

if (!forGetInfoURLRequest.ssgParams) {
yusukebe marked this conversation as resolved.
Show resolved Hide resolved
if (isDynamicRoute(route.path)) continue
forGetInfoURLRequest.ssgParams = [{}]
}

Expand Down