Skip to content

Commit

Permalink
fix(nuxt): remove trailing slash before checking if prerendered (#24516)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe authored and manniL committed Dec 11, 2023
1 parent 65bbeed commit a21118a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/nuxt/src/app/composables/payload.ts
@@ -1,4 +1,4 @@
import { hasProtocol, joinURL } from 'ufo'
import { hasProtocol, joinURL, withoutTrailingSlash } from 'ufo'
import { parse } from 'devalue'
import { useHead } from '@unhead/vue'
import { getCurrentInstance } from 'vue'
Expand Down Expand Up @@ -79,6 +79,7 @@ async function _importPayload (payloadURL: string) {
export async function isPrerendered (url = useRoute().path) {
// Note: Alternative for server is checking x-nitro-prerender header
if (!appManifest) { return !!useNuxtApp().payload.prerenderedAt }
url = withoutTrailingSlash(url)
const manifest = await getAppManifest()
if (manifest.prerendered.includes(url)) {
return true
Expand Down

0 comments on commit a21118a

Please sign in to comment.