Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

Commit 28d8a6b

Browse files
author
Wenjie Xia
committed
fix: fix #102
1 parent b086df6 commit 28d8a6b

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

framework/react/bootstrap.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export default async function bootstrap({ baseUrl, defaultLocale, locales, route
5757
pageComponentTree
5858
}
5959
)
60-
const mountPoint = document.querySelector('main')
60+
const mountPoint = document.getElementById('__aleph')
6161
if (renderMode === 'ssr') {
6262
hydrate(rootEl, mountPoint)
6363
} else {

server/app.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ export class Appliaction {
186186
...this.getScripts()
187187
],
188188
head: customLoading?.head || [],
189-
body: `<main>${customLoading?.body || ''}</main>`,
189+
body: `<div id="__aleph">${customLoading?.body || ''}</div>`,
190190
minify: !this.isDev
191191
})
192192
return html
@@ -1450,7 +1450,7 @@ export class Appliaction {
14501450
status: url.pagePath === '' ? 404 : 200,
14511451
head: [],
14521452
scripts: [],
1453-
body: '<main></main>',
1453+
body: '<div id="__aleph"></div>',
14541454
data: null,
14551455
}
14561456
if (ret.status === 404) {
@@ -1496,7 +1496,7 @@ export class Appliaction {
14961496
}
14971497
return script
14981498
}))
1499-
ret.body = `<main>${body}</main>`
1499+
ret.body = `<div id="__aleph">${body}</div>`
15001500
ret.data = data
15011501
this.#renderCache.get(url.pagePath)!.set(key, ret)
15021502
if (this.isDev) {
@@ -1505,7 +1505,7 @@ export class Appliaction {
15051505
} catch (err) {
15061506
ret.status = 500
15071507
ret.head = ['<title>Error 500 - Aleph.js</title>']
1508-
ret.body = `<main><pre>${colors.stripColor(err.stack)}</pre></main>`
1508+
ret.body = `<div id="__aleph"><pre>${colors.stripColor(err.stack)}</pre></div>`
15091509
log.error(err)
15101510
}
15111511
return ret
@@ -1535,7 +1535,7 @@ export class Appliaction {
15351535

15361536
/** render custom 404 page. */
15371537
private async render404Page(url: RouterURL = { locale: this.config.defaultLocale, pagePath: '', pathname: '/', params: {}, query: new URLSearchParams() }) {
1538-
const ret: RenderResult = { url, status: 404, head: [], scripts: [], body: '<main></main>', data: null }
1538+
const ret: RenderResult = { url, status: 404, head: [], scripts: [], body: '<div id="__aleph"></div>', data: null }
15391539
try {
15401540
const e404Module = Array.from(this.#modules.keys())
15411541
.filter(url => url.replace(reModuleExt, '') == '/404')
@@ -1555,12 +1555,12 @@ export class Appliaction {
15551555
}
15561556
return script
15571557
}))
1558-
ret.body = `<main>${body}</main>`
1558+
ret.body = `<div id="__aleph">${body}</div>`
15591559
ret.data = data
15601560
} catch (err) {
15611561
ret.status = 500
15621562
ret.head = ['<title>Error 500 - Aleph.js</title>']
1563-
ret.body = `<main><pre>${colors.stripColor(err.stack)}</pre></main>`
1563+
ret.body = `<div id="__aleph"><pre>${colors.stripColor(err.stack)}</pre></div>`
15641564
log.error(err)
15651565
}
15661566
return ret
@@ -1592,7 +1592,7 @@ export class Appliaction {
15921592
)
15931593
return {
15941594
head,
1595-
body: `<main>${body}</main>`
1595+
body: `<div id="__aleph">${body}</div>`
15961596
} as Pick<RenderResult, 'head' | 'body'>
15971597
}
15981598
return null

0 commit comments

Comments
 (0)