mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 07:05:11 +00:00
fix(nuxt): fix ssr log querySelector (#28864)
Co-authored-by: Julien Huang <julien.huang@outlook.fr>
This commit is contained in:
parent
fcf023e611
commit
d5cf409ddc
@ -40,7 +40,7 @@ export default defineNuxtPlugin(async (nuxtApp) => {
|
||||
}
|
||||
|
||||
if (typeof window !== 'undefined') {
|
||||
const nuxtLogsElement = document.querySelector(`[data-nuxt-logs="${nuxtApp._name}"]`)
|
||||
const nuxtLogsElement = document.querySelector(`[data-nuxt-logs="${nuxtApp._id}"]`)
|
||||
const content = nuxtLogsElement?.textContent
|
||||
const logs = content ? parse(content, { ...devRevivers, ...nuxtApp._payloadRevivers }) as LogObject[] : []
|
||||
await nuxtApp.hooks.callHook('dev:ssr-logs', logs)
|
||||
|
Loading…
Reference in New Issue
Block a user