Skip to content

Commit 6eb0317

Browse files
committed
fix: register EmbeddableBlueskyPost during SSR to resolve anonymous component warning
The EmbeddableBlueskyPost plugin was client-only (.client.ts), meaning the component was unregistered during SSR when unplugin-vue-markdown compiles the blog.md files. This produces the "missing template or render function" warning. Convert the component and plugin to be included during SSR but use <ClientOnly> for browser-only rendering.
1 parent ba705b6 commit 6eb0317

File tree

2 files changed

+28
-26
lines changed

2 files changed

+28
-26
lines changed

app/components/EmbeddableBlueskyPost.client.vue renamed to app/components/EmbeddableBlueskyPost.vue

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -50,33 +50,35 @@ function onPostMessage(event: MessageEvent) {
5050
</script>
5151

5252
<template>
53-
<article class="bluesky-embed-container">
54-
<!-- Loading state -->
55-
<LoadingSpinner
56-
v-if="isLoading"
57-
:text="$t('blog.atproto.loading_bluesky_post')"
58-
aria-label="Loading Bluesky post..."
59-
class="loading-spinner"
60-
/>
61-
62-
<!-- Success state -->
63-
<div v-else-if="embedUrl" class="bluesky-embed-container">
64-
<iframe
65-
title="Bluesky Post"
66-
:data-bluesky-id="embeddedId"
67-
:src="embedUrl"
68-
width="100%"
69-
:height="iframeHeight"
70-
frameborder="0"
71-
scrolling="no"
53+
<ClientOnly>
54+
<article class="bluesky-embed-container">
55+
<!-- Loading state -->
56+
<LoadingSpinner
57+
v-if="isLoading"
58+
:text="$t('blog.atproto.loading_bluesky_post')"
59+
aria-label="Loading Bluesky post..."
60+
class="loading-spinner"
7261
/>
73-
</div>
7462

75-
<!-- Fallback state -->
76-
<a v-else :href="url" target="_blank" rel="noopener noreferrer">
77-
{{ $t('blog.atproto.view_on_bluesky') }}
78-
</a>
79-
</article>
63+
<!-- Success state -->
64+
<div v-else-if="embedUrl" class="bluesky-embed-container">
65+
<iframe
66+
title="Bluesky Post"
67+
:data-bluesky-id="embeddedId"
68+
:src="embedUrl"
69+
width="100%"
70+
:height="iframeHeight"
71+
frameborder="0"
72+
scrolling="no"
73+
/>
74+
</div>
75+
76+
<!-- Fallback state -->
77+
<a v-else :href="url" target="_blank" rel="noopener noreferrer">
78+
{{ $t('blog.atproto.view_on_bluesky') }}
79+
</a>
80+
</article>
81+
</ClientOnly>
8082
</template>
8183

8284
<style scoped>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import EmbeddableBlueskyPost from '~/components/EmbeddableBlueskyPost.client.vue'
1+
import EmbeddableBlueskyPost from '~/components/EmbeddableBlueskyPost.vue'
22

33
/**
44
* INFO: .md files are transformed into Vue SFCs by unplugin-vue-markdown during the Vite transform pipeline

0 commit comments

Comments
 (0)