Skip to content

primo build output differs from server publish (several build failures) #56

Open

Description

@Amerlander

I tried deploying sites with primo build instead of the server publish and the output differed in quite a few places. Some of them break the build, some just render wrong. All reproduced on current master with a small fixture site:

  • A block importing svelte/transition (or any subpath) fails with Could not resolve ".../svelte/src/index.js/transition". The aliases point at svelte/src/index.js, which svelte 5 doesn't have.
  • Blocks that use their fields as bare identifiers fail with "headline is not defined". Server publish injects let { ...fields } = $props(), the build doesn't.
  • Image values with an empty url render as src="", both for upload: <id> and upload: uploads/<file>.
  • Rich text renders as [object Object], markdown fields come out as raw markdown.
  • Empty fields don't get the server's empty values, so a block reading image.url crashes the build on a section the server renders fine.
  • page, page-list and page-field fields aren't resolved; the build fails with "Cannot read properties of undefined (reading 'name')".
  • No client JS is emitted at all, so interactive blocks don't work.
  • uploads/.manifest.json (server record ids and hashes) gets copied into the output.
  • Uploads end up under /uploads/ while the server uses /_uploads/, so CMS paths in content 404.
  • The head uses a different CSS reset than the server's baseline CSS, and the page type's foot code isn't included.

I fixed these in my fork, one commit and regression test per item, if that's useful: master...Amerlander:primo-cli:fix/static-build-output

Happy to open it as a PR or split it up if you want any of it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions