Skip to content

defineAsyncComponent bug on cloudflare workers #1722

@mrleblanc101

Description

@mrleblanc101

In app/slices/index.ts, we need to replace:
accordions: defineAsyncComponent(() => import('./Accordions/index.vue')),
by this:
accordions: defineAsyncComponent(() => import('./Accordions/index.vue').then((r) => r.default)),
Otherwise SSR doesn't work on Cloudflare Workers because of hydration mismatch !
See nuxt/nuxt#33270

Versions

  • slice-machine-ui: 2.19.1
  • node: v22.16.0

When did this happen?

When deploying with SSR to Cloudflare Workers

Reproduction

Not really a repro, because I don't know how I could repro this.
But here is the repo I'm trying to deploy: https://github.com/capitalenumerique/interfaceqc

Steps to reproduce

  • Create a new Cloudflare Worker.
  • Use the default configuration
  • Link to a fork of the provided repo
  • Notice in the console the hydration mismatch issue (or check here: https://interfaceqc.admin-a5d.workers.dev/)
  • To go further, disable JavaScript in the browser, notice that the homepage doesn't display anything anymore

What is expected?

  • Using Prismic/Slice-machine shouldn't cause node mismatch issue.

What is actually happening?

  • There are node mismatch leading to broken SSR

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions