Skip to content

Commit

Permalink
fix: multiple cache busting imports causing useData to fail
Browse files Browse the repository at this point in the history
closes #3820
reverts #3398
reopens #3363
  • Loading branch information
brc-dd committed Aug 5, 2024
1 parent b6a36bc commit 2b3e486
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 10 deletions.
2 changes: 0 additions & 2 deletions src/client/app/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,6 @@ function newRouter(): Router {
url.hash
return import(/*@vite-ignore*/ path)
})
} else if (import.meta.env.SSR) {
pageModule = import(/*@vite-ignore*/ `${pageFilePath}?t=${Date.now()}`)
} else {
pageModule = import(/*@vite-ignore*/ pageFilePath)
}
Expand Down
4 changes: 1 addition & 3 deletions src/node/build/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ export async function build(
}

const entryPath = path.join(siteConfig.tempDir, 'app.js')
const { render } = await import(
pathToFileURL(entryPath).toString() + '?t=' + Date.now()
)
const { render } = await import(pathToFileURL(entryPath).href)

await task('rendering pages', async () => {
const appChunk =
Expand Down
6 changes: 1 addition & 5 deletions src/node/build/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,7 @@ export async function renderPage(
try {
// resolve page data so we can render head tags
const { __pageData } = await import(
pathToFileURL(
path.join(config.tempDir, pageServerJsFileName)
).toString() +
'?t=' +
Date.now()
pathToFileURL(path.join(config.tempDir, pageServerJsFileName)).href
)
pageData = __pageData
} catch (e) {
Expand Down

0 comments on commit 2b3e486

Please sign in to comment.