From b5bf4bdafc5a0dea04c8fde422f5b9efeeec8b9e Mon Sep 17 00:00:00 2001 From: Jeffrey Dowdle Date: Fri, 29 Dec 2023 09:00:20 +1100 Subject: [PATCH 1/7] fix(@dpc-sdp/nuxt-ripple): prevented url params being stripped for cached pages --- packages/nuxt-ripple/plugins/ssr-url-params-fix.ts | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 packages/nuxt-ripple/plugins/ssr-url-params-fix.ts diff --git a/packages/nuxt-ripple/plugins/ssr-url-params-fix.ts b/packages/nuxt-ripple/plugins/ssr-url-params-fix.ts new file mode 100644 index 0000000000..94bf13b2e9 --- /dev/null +++ b/packages/nuxt-ripple/plugins/ssr-url-params-fix.ts @@ -0,0 +1,7 @@ +export default defineNuxtPlugin((nuxtApp) => { + // Remove path from nuxt payload to prevent query params from being stripped + // The path we are removing is the path that was cached during the server side render + // https://github.com/nuxt/nuxt/pull/21408 + // https://github.com/nuxt/nuxt/issues/23153 + delete nuxtApp?.payload?.path +}) From 3e7bb2f63c929610256260fc862b22026c418215 Mon Sep 17 00:00:00 2001 From: Jeffrey Dowdle Date: Fri, 29 Dec 2023 08:55:56 +1100 Subject: [PATCH 2/7] fix(@dpc-sdp/nuxt-ripple): fixed 'A composable that requires access to the Nuxt instance...' error --- packages/nuxt-ripple/composables/use-merge-section-tags.ts | 4 +--- packages/nuxt-ripple/composables/use-tide-page.ts | 4 ++-- packages/nuxt-ripple/composables/use-tide-site.ts | 5 +++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/packages/nuxt-ripple/composables/use-merge-section-tags.ts b/packages/nuxt-ripple/composables/use-merge-section-tags.ts index f1a6e4eb40..45870a3258 100644 --- a/packages/nuxt-ripple/composables/use-merge-section-tags.ts +++ b/packages/nuxt-ripple/composables/use-merge-section-tags.ts @@ -9,9 +9,7 @@ const mergeTags = (existingTags: string, newTags: string): string => { return tags.join(' ') } -export const useMergeSectionTags = async ( - sectionCacheTags: any -): Promise => { +export const useMergeSectionTags = (sectionCacheTags: string | null): void => { // event will be undefined if the request is on the client side const event = useRequestEvent() diff --git a/packages/nuxt-ripple/composables/use-tide-page.ts b/packages/nuxt-ripple/composables/use-tide-page.ts index cb11b1bb05..622bb827a1 100644 --- a/packages/nuxt-ripple/composables/use-tide-page.ts +++ b/packages/nuxt-ripple/composables/use-tide-page.ts @@ -73,7 +73,7 @@ export const useTidePage = async ( headers.cookie = `${AuthCookieNames.ACCESS_TOKEN}=${accessTokenCookie.value};${AuthCookieNames.ACCESS_TOKEN_EXPIRY}=${accessTokenExpiryCookie.value}` } - let sectionCacheTags + let sectionCacheTags: string | null = null if (!pageData.value) { const { data, error } = await useFetch('/api/tide/page', { @@ -95,7 +95,7 @@ export const useTidePage = async ( // Section.io cache tags must be set on the response header to invalidate the cache after a change in drupal if (sectionCacheTags) { - useMergeSectionTags(sectionCacheTags) + nuxt.runWithContext(() => useMergeSectionTags(sectionCacheTags)) } if (error && error.value?.statusCode) { diff --git a/packages/nuxt-ripple/composables/use-tide-site.ts b/packages/nuxt-ripple/composables/use-tide-site.ts index 867cc63a46..672dc3cb7b 100644 --- a/packages/nuxt-ripple/composables/use-tide-site.ts +++ b/packages/nuxt-ripple/composables/use-tide-site.ts @@ -4,8 +4,9 @@ export const useTideSite = async (id?: number): Promise => { const { public: config } = useRuntimeConfig() const siteId = id || config.tide?.site const { data: siteData } = useNuxtData(`site-${siteId}`) + const nuxt = useNuxtApp() - let sectionCacheTags + let sectionCacheTags: string | null = null if (!siteData.value) { const { data, error } = await useFetch('/api/tide/site', { @@ -26,7 +27,7 @@ export const useTideSite = async (id?: number): Promise => { // Section.io cache tags must be set on the response header to invalidate the cache after a change in drupal if (sectionCacheTags) { - useMergeSectionTags(sectionCacheTags) + nuxt.runWithContext(() => useMergeSectionTags(sectionCacheTags)) } return data.value From dd23d05331105dd73001fde54f24b3fa3980ad2a Mon Sep 17 00:00:00 2001 From: Jeffrey Dowdle Date: Wed, 13 Dec 2023 13:29:08 +1100 Subject: [PATCH 3/7] feat(@dpc-sdp/nuxt-ripple): adds logging in vue/nuxt contexts --- .gitignore | 2 +- packages/nuxt-ripple/composables/use-logger.ts | 17 +++++++++++++++++ .../nuxt-ripple/plugins/00.logging.server.ts | 10 ++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 packages/nuxt-ripple/composables/use-logger.ts create mode 100644 packages/nuxt-ripple/plugins/00.logging.server.ts diff --git a/.gitignore b/.gitignore index 6242e8a82c..a1c4421952 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ # Temporary files node_modules -*.log* +*.log .nuxt .nitro .cache diff --git a/packages/nuxt-ripple/composables/use-logger.ts b/packages/nuxt-ripple/composables/use-logger.ts new file mode 100644 index 0000000000..dfb1af4908 --- /dev/null +++ b/packages/nuxt-ripple/composables/use-logger.ts @@ -0,0 +1,17 @@ +export const useLogger = (id?: number) => { + const { $logger } = useNuxtApp() + const noop = () => {} + + if (process.server) { + return $logger + } + + return { + debug: noop, + info: noop, + warning: noop, + error: noop + } +} + +export default useLogger diff --git a/packages/nuxt-ripple/plugins/00.logging.server.ts b/packages/nuxt-ripple/plugins/00.logging.server.ts new file mode 100644 index 0000000000..c02788d78a --- /dev/null +++ b/packages/nuxt-ripple/plugins/00.logging.server.ts @@ -0,0 +1,10 @@ +import { defineNuxtPlugin } from '#app' +import { logger } from '@dpc-sdp/ripple-tide-api' + +export default defineNuxtPlugin(() => { + return { + provide: { + logger + } + } +}) From 7aafb0296f5b49f37e3b5675c6abc3efef61db22 Mon Sep 17 00:00:00 2001 From: Jeffrey Dowdle Date: Fri, 29 Dec 2023 08:29:46 +1100 Subject: [PATCH 4/7] style(@dpc-sdp/nuxt-ripple): fixed linting --- packages/nuxt-ripple/composables/use-logger.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nuxt-ripple/composables/use-logger.ts b/packages/nuxt-ripple/composables/use-logger.ts index dfb1af4908..98d0e1ba36 100644 --- a/packages/nuxt-ripple/composables/use-logger.ts +++ b/packages/nuxt-ripple/composables/use-logger.ts @@ -1,4 +1,4 @@ -export const useLogger = (id?: number) => { +export const useLogger = () => { const { $logger } = useNuxtApp() const noop = () => {} From 4cdced834733477b303af6fb8962e32c292b732a Mon Sep 17 00:00:00 2001 From: Jeffrey Dowdle Date: Wed, 27 Dec 2023 11:07:15 +1100 Subject: [PATCH 5/7] feat(@dpc-sdp/ripple-tide-api): add section id to logging messages and add debug info --- .../nuxt-ripple/composables/use-section-id.ts | 9 +++ .../nuxt-ripple/composables/use-tide-page.ts | 74 +++++++++++++++++-- .../nuxt-ripple/composables/use-tide-site.ts | 12 +++ packages/nuxt-ripple/server/api/tide/page.ts | 8 +- packages/nuxt-ripple/server/api/tide/site.ts | 4 +- .../src/services/http-client.ts | 10 ++- .../ripple-tide-api/src/services/tide-page.ts | 35 ++++++--- .../ripple-tide-api/src/services/tide-site.ts | 5 +- 8 files changed, 134 insertions(+), 23 deletions(-) create mode 100644 packages/nuxt-ripple/composables/use-section-id.ts diff --git a/packages/nuxt-ripple/composables/use-section-id.ts b/packages/nuxt-ripple/composables/use-section-id.ts new file mode 100644 index 0000000000..0fe5d00ab6 --- /dev/null +++ b/packages/nuxt-ripple/composables/use-section-id.ts @@ -0,0 +1,9 @@ +import { useRequestHeaders } from '#imports' + +export const useSectionId = (): string => { + const sectionIdHeaderName = 'x-request-id' + const requestHeaders = useRequestHeaders([sectionIdHeaderName]) + return requestHeaders[sectionIdHeaderName] || 'no section id' +} + +export default useSectionId diff --git a/packages/nuxt-ripple/composables/use-tide-page.ts b/packages/nuxt-ripple/composables/use-tide-page.ts index 622bb827a1..93f9b4e6ab 100644 --- a/packages/nuxt-ripple/composables/use-tide-page.ts +++ b/packages/nuxt-ripple/composables/use-tide-page.ts @@ -1,5 +1,11 @@ import type { TidePageBase } from './../types' -import { useCookie, isPreviewPath, AuthCookieNames } from '#imports' +import { + useCookie, + isPreviewPath, + AuthCookieNames, + useLogger, + useSectionId +} from '#imports' const isCacheTimeExpired = (date: number, expiryInMinutes = 5) => { // 5 minute default expiry in step with varnish cache @@ -8,7 +14,7 @@ const isCacheTimeExpired = (date: number, expiryInMinutes = 5) => { return date < timePlusExpiry } -const checkForRedirect = async (page: TidePageBase) => { +const checkForRedirect = async (page: TidePageBase, debugLogger) => { // Redirect on the 6 codes that Drupal supplies if (page?.type === 'redirect') { switch (page.status_code) { @@ -18,6 +24,13 @@ const checkForRedirect = async (page: TidePageBase) => { case '304': case '305': case '307': + debugLogger(`Redirecting to ${page?.redirect_url}`, { + pageType: page?.type, + pageRedirectUrl: page?.redirect_url, + pageRedirectType: page?.redirect_type, + pageStatusCode: page?.status_code + }) + await navigateTo(page.redirect_url, { replace: true, redirectCode: page.status_code, @@ -33,15 +46,39 @@ export const useTidePage = async ( slug?: string, site?: number ): Promise => { + const logger = useLogger() const route = useRoute() + const path = slug || route.path const { public: config } = useRuntimeConfig() const siteId = site || config.tide?.site + const sectionRequestId = useSectionId() + + const debugLogger = (message: string, data = {}) => { + logger.debug(message, { + label: 'useTidePage', + section_io_id: sectionRequestId, + ...data + }) + } + + debugLogger('Route requested', { + path, + siteId + }) + // check we dont add too many keys to cache const nuxt = useNuxtApp() const maxCacheItems = 50 if (nuxt.payload.data) { + debugLogger( + `Nuxt cache length is: ${Object.keys(nuxt.payload.data).length}`, + { + nuxtCacheKeys: Object.keys(nuxt.payload.data) + } + ) + if (Object.keys(nuxt.payload.data).length > maxCacheItems + 1) { if (process.dev) { console.log('clear nuxt cache') @@ -58,11 +95,22 @@ export const useTidePage = async ( if (process.dev) { console.log('Cache reset for page', `page-${path}`) } + + debugLogger( + 'Cached data for this page is stale, clearing nuxt cache just for this page...', + { + cacheKey: `page-${path}` + } + ) + await clearNuxtData(`page-${path}`) } } - const headers = {} + const headers: { + cookie?: string + 'x-section-request-id'?: string + } = {} // Need to manually pass the cookies needed for auth as they aren't automatically added when server rendered if (isPreviewPath(path)) { @@ -73,9 +121,15 @@ export const useTidePage = async ( headers.cookie = `${AuthCookieNames.ACCESS_TOKEN}=${accessTokenCookie.value};${AuthCookieNames.ACCESS_TOKEN_EXPIRY}=${accessTokenExpiryCookie.value}` } + if (process.server) { + headers['x-section-request-id'] = sectionRequestId + } + let sectionCacheTags: string | null = null if (!pageData.value) { + debugLogger('No cached page found, fetching the page data...') + const { data, error } = await useFetch('/api/tide/page', { key: `page-${path}`, baseURL: config.apiUrl || '', @@ -102,12 +156,22 @@ export const useTidePage = async ( useTideError(error.value?.statusCode) } - await checkForRedirect(data.value) + debugLogger('Page data fetched', { + pageTitle: data.value.title, + pageNodeId: data.value.nid + }) + + await checkForRedirect(data.value, debugLogger) return data.value } - await checkForRedirect(pageData.value) + debugLogger('Cached data for this page was found and is being used...', { + pageTitle: pageData.value.title, + pageNodeId: pageData.value.nid + }) + + await checkForRedirect(pageData.value, debugLogger) return pageData.value } diff --git a/packages/nuxt-ripple/composables/use-tide-site.ts b/packages/nuxt-ripple/composables/use-tide-site.ts index 672dc3cb7b..a36a58ffb3 100644 --- a/packages/nuxt-ripple/composables/use-tide-site.ts +++ b/packages/nuxt-ripple/composables/use-tide-site.ts @@ -1,4 +1,5 @@ import type { TideSiteData } from './../types' +import { useSectionId } from '#imports' export const useTideSite = async (id?: number): Promise => { const { public: config } = useRuntimeConfig() @@ -6,6 +7,16 @@ export const useTideSite = async (id?: number): Promise => { const { data: siteData } = useNuxtData(`site-${siteId}`) const nuxt = useNuxtApp() + const sectionRequestId = useSectionId() + + const headers: { + 'x-section-request-id'?: string + } = {} + + if (process.server) { + headers['x-section-request-id'] = sectionRequestId + } + let sectionCacheTags: string | null = null if (!siteData.value) { @@ -15,6 +26,7 @@ export const useTideSite = async (id?: number): Promise => { params: { id: siteId }, + headers, async onResponse({ response }) { sectionCacheTags = response.headers.get('section-cache-tags') } diff --git a/packages/nuxt-ripple/server/api/tide/page.ts b/packages/nuxt-ripple/server/api/tide/page.ts index ce34a582b3..5b6d35fc89 100644 --- a/packages/nuxt-ripple/server/api/tide/page.ts +++ b/packages/nuxt-ripple/server/api/tide/page.ts @@ -4,7 +4,8 @@ import { getQuery, H3Event, getCookie, - setResponseHeader + setResponseHeader, + getHeader } from 'h3' import { createHandler, TidePageApi } from '@dpc-sdp/ripple-tide-api' import { BadRequestError } from '@dpc-sdp/ripple-tide-api/errors' @@ -41,11 +42,14 @@ export const createPageHandler = async ( headers['X-OAuth2-Authorization'] = `Bearer ${tokenCookie}` } + const sectionId = getHeader(event, 'x-section-request-id') + const pageResponse = await tidePageApi.getPageByPath( query.path, query.site, {}, - headers + headers, + sectionId ) // Need to pass on the section cache tags to the nuxt app diff --git a/packages/nuxt-ripple/server/api/tide/site.ts b/packages/nuxt-ripple/server/api/tide/site.ts index 23013fd6f3..1100f1429f 100644 --- a/packages/nuxt-ripple/server/api/tide/site.ts +++ b/packages/nuxt-ripple/server/api/tide/site.ts @@ -15,7 +15,9 @@ export const createSiteHandler = async ( throw new BadRequestError('Site id is required') } - const siteResponse = await tideSiteApi.getSiteData(query.id) + const sectionId = getHeader(event, 'x-section-request-id') + + const siteResponse = await tideSiteApi.getSiteData(query.id, sectionId) // Need to pass on the section cache tags to the nuxt app if (siteResponse.headers && siteResponse.headers['section-cache-tags']) { diff --git a/packages/ripple-tide-api/src/services/http-client.ts b/packages/ripple-tide-api/src/services/http-client.ts index df4b6c8ace..51c9d00199 100644 --- a/packages/ripple-tide-api/src/services/http-client.ts +++ b/packages/ripple-tide-api/src/services/http-client.ts @@ -38,7 +38,11 @@ export default class HttpClient { `${request.method?.toUpperCase()} request to ${this.client.getUri( request )}`, - { label: this.logLabel } + { + label: this.logLabel, + // _logId is a custom property added by us https://github.com/axios/axios/issues/2203 + section_io_id: (request as any)._logId || 'no section id' + } ) return request }, @@ -62,7 +66,9 @@ export default class HttpClient { error.request.path }`, { - label: this.logLabel + label: this.logLabel, + // _logId is a custom property added by us https://github.com/axios/axios/issues/2203 + section_io_id: error.request?._logId || 'no section id' } ) } else { diff --git a/packages/ripple-tide-api/src/services/tide-page.ts b/packages/ripple-tide-api/src/services/tide-page.ts index 040da85d18..fccef9ff6d 100644 --- a/packages/ripple-tide-api/src/services/tide-page.ts +++ b/packages/ripple-tide-api/src/services/tide-page.ts @@ -82,12 +82,17 @@ export default class TidePageApi extends TideApiBase { } } - async getRouteByPath(path: string, site: string = this.site, headers = {}) { + async getRouteByPath( + path: string, + site: string = this.site, + headers = {}, + logId?: string + ) { this.path = path const routeUrl = `/route?site=${site}&path=${path}` - return this.get(routeUrl, { headers }) + return this.get(routeUrl, { headers, _logId: logId }) .then((response) => response?.data?.data?.attributes) .catch((error) => { throw new NotFoundError( @@ -103,19 +108,20 @@ export default class TidePageApi extends TideApiBase { path: string, siteQuery: string | undefined, params = {}, - headers = {} + headers = {}, + logId?: string ) { const site = siteQuery || this.site if (this.isShareLink(path)) { - return this.getPageByShareLink(path, site) + return this.getPageByShareLink(path, site, logId) } if (this.isPreviewLink(path)) { - return this.getPageFromPreviewLink(path, site, params, headers) + return this.getPageFromPreviewLink(path, site, params, headers, logId) } - const route = await this.getRouteByPath(path, site, headers) + const route = await this.getRouteByPath(path, site, headers, logId) if (route && !route.error) { if (route.hasOwnProperty('redirect_type')) { return { @@ -133,11 +139,15 @@ export default class TidePageApi extends TideApiBase { if (includes !== '') { fullParams['include'] = includes } - return this.getPageByRouteData(route, { params: fullParams, headers }) + return this.getPageByRouteData(route, { + params: fullParams, + headers, + _logId: logId + }) } } - async getPageByShareLink(path: string, site: string) { + async getPageByShareLink(path: string, site: string, logId?: string) { const response = await this.get(path).then(({ data: res }) => { return res?.data ? jsonapiParse.parse(res).data || res.data : null }) @@ -163,7 +173,8 @@ export default class TidePageApi extends TideApiBase { return await this.getPageByRouteData(routeData, { headers: { 'X-Share-Link-Token': response.id }, - params + params, + _logId: logId }) } @@ -171,7 +182,8 @@ export default class TidePageApi extends TideApiBase { path, site, params = {}, - headers = {} + headers = {}, + logId?: string ): Promise { try { const { 2: contentType, 3: uuid, 4: revisionId } = path.split('/') @@ -193,7 +205,8 @@ export default class TidePageApi extends TideApiBase { return await this.getPageByRouteData(routeData, { headers, - params: fullParams + params: fullParams, + _logId: logId }) } catch (error) { throw new NotFoundError(`Couldn't get page preview`, { diff --git a/packages/ripple-tide-api/src/services/tide-site.ts b/packages/ripple-tide-api/src/services/tide-site.ts index 27b324cd0e..45128c3058 100644 --- a/packages/ripple-tide-api/src/services/tide-site.ts +++ b/packages/ripple-tide-api/src/services/tide-site.ts @@ -19,7 +19,7 @@ export default class TideSite extends TideApiBase { this.siteMapping = siteMapping } - async getSiteData(siteid) { + async getSiteData(siteid, logId?: string) { if (!this.siteMapping) { throw new Error('Error loading site mapping') } @@ -41,7 +41,8 @@ export default class TideSite extends TideApiBase { const { data: response, headers } = await this.get( `/taxonomy_term/sites`, { - params + params, + _logId: logId } ) if (response && response.data.length > 0) { From c9ddf6fa5d859b25fc08fc2438cc12c20ce87a7e Mon Sep 17 00:00:00 2001 From: dylankelly Date: Fri, 12 Jan 2024 15:17:17 +1100 Subject: [PATCH 6/7] chore: remove console log --- packages/nuxt-ripple/composables/use-tide-page.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/packages/nuxt-ripple/composables/use-tide-page.ts b/packages/nuxt-ripple/composables/use-tide-page.ts index 93f9b4e6ab..2f890649c6 100644 --- a/packages/nuxt-ripple/composables/use-tide-page.ts +++ b/packages/nuxt-ripple/composables/use-tide-page.ts @@ -80,9 +80,7 @@ export const useTidePage = async ( ) if (Object.keys(nuxt.payload.data).length > maxCacheItems + 1) { - if (process.dev) { - console.log('clear nuxt cache') - } + debugLogger(`Cache is larger than max ${maxCacheItems} items, clearing...`) clearNuxtData() } } @@ -92,9 +90,6 @@ export const useTidePage = async ( // Refresh data so it doesnt go stale whilst client side nav if (pageData.value && pageData.value._fetched) { if (isCacheTimeExpired(pageData.value._fetched)) { - if (process.dev) { - console.log('Cache reset for page', `page-${path}`) - } debugLogger( 'Cached data for this page is stale, clearing nuxt cache just for this page...', From 807fc51f0b62ff9207a27be8c76f7f4b8a7569fe Mon Sep 17 00:00:00 2001 From: David Featherston Date: Tue, 23 Jan 2024 10:55:50 +1100 Subject: [PATCH 7/7] fix(@dpc-sdp/nuxt-ripple): wrap navigateTo to get redirects working again --- .../nuxt-ripple/composables/use-tide-page.ts | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/packages/nuxt-ripple/composables/use-tide-page.ts b/packages/nuxt-ripple/composables/use-tide-page.ts index 2f890649c6..67e7be6899 100644 --- a/packages/nuxt-ripple/composables/use-tide-page.ts +++ b/packages/nuxt-ripple/composables/use-tide-page.ts @@ -14,7 +14,7 @@ const isCacheTimeExpired = (date: number, expiryInMinutes = 5) => { return date < timePlusExpiry } -const checkForRedirect = async (page: TidePageBase, debugLogger) => { +const checkForRedirect = async (page: TidePageBase, debugLogger, nuxt) => { // Redirect on the 6 codes that Drupal supplies if (page?.type === 'redirect') { switch (page.status_code) { @@ -31,11 +31,13 @@ const checkForRedirect = async (page: TidePageBase, debugLogger) => { pageStatusCode: page?.status_code }) - await navigateTo(page.redirect_url, { - replace: true, - redirectCode: page.status_code, - external: page.redirect_type === 'external' - }) + await nuxt.runWithContext(() => + navigateTo(page.redirect_url, { + replace: true, + redirectCode: page.status_code, + external: page.redirect_type === 'external' + }) + ) break default: } @@ -80,7 +82,9 @@ export const useTidePage = async ( ) if (Object.keys(nuxt.payload.data).length > maxCacheItems + 1) { - debugLogger(`Cache is larger than max ${maxCacheItems} items, clearing...`) + debugLogger( + `Cache is larger than max ${maxCacheItems} items, clearing...` + ) clearNuxtData() } } @@ -90,7 +94,6 @@ export const useTidePage = async ( // Refresh data so it doesnt go stale whilst client side nav if (pageData.value && pageData.value._fetched) { if (isCacheTimeExpired(pageData.value._fetched)) { - debugLogger( 'Cached data for this page is stale, clearing nuxt cache just for this page...', { @@ -156,7 +159,7 @@ export const useTidePage = async ( pageNodeId: data.value.nid }) - await checkForRedirect(data.value, debugLogger) + await checkForRedirect(data.value, debugLogger, nuxt) return data.value } @@ -166,7 +169,7 @@ export const useTidePage = async ( pageNodeId: pageData.value.nid }) - await checkForRedirect(pageData.value, debugLogger) + await checkForRedirect(pageData.value, debugLogger, nuxt) return pageData.value }