Skip to content

SSR in dev for more consistent output in dev and prod #4045

@zyyv

Description

@zyyv

Describe the bug

Usage:

features:
  - icon: <i class="i-carbon-sun" />
    title: Feature A
    details: Lorem ipsum dolor sit amet, consectetur adipiscing elit

Check the feature icon type

type FeatureIcon =
  | string
  | { src: string; alt?: string; width?: string; height: string }
  | {
      light: string
      dark: string
      alt?: string
      width?: string
      height: string
    }

I refer to the render logic, use v-html render the icon.
Display well in dev environment, but shows errors in prod environment.

dev build
dev build

Reproduction

https://stackblitz.com/github/zyyv/vitepress-unocss-issue

  • Display right run pnpm dev
  • Display error run pnpm build && pnpm preview

Expected behavior

Dev and build behave the same

System Info

latest

Additional context

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildRelated to the build systemhas-workaroundHas workaround, low prioritystale

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions