vike: Error [RollupError]: Could not resolve "../dist/assets.json" from "renderer/_default.page.server.ts" after upgrade 0.4.161

Description

I import manifest inside renderer/_default.page.server.ts:

const getManifest = import('../dist/assets.json').catch(() => ({ default: {} }))

After upgrade from 0.4.160 -> 0.4.161 (or higher) I discovered assets.json renamed client/_temp_manifest.json

After build error I looked at the changelog again https://github.com/vikejs/vike/blob/main/CHANGELOG.md, but didn’t see this change or guid for migration

About this issue

  • Original URL
  • State: closed
  • Created 4 months ago
  • Comments: 18 (10 by maintainers)

Commits related to this issue

Most upvoted comments

const rollupStaticAnalysisBuster = 1 + 1 < 10 ? '' : 'rollupStaticAnalysisBuster'
let manifest
export async funcion onRenderHtml() {
  manifest = manifest ?? await import("../dist/client/assets.json" + rollupStaticAnalysisBuster)
}

Also, I will make the assets manifest available over pageContext.

I’ll double check the source code for race conditions. I’ll report back (ETA today or tomorrow).