Skip to content

Commit

Permalink
fix: greater type safety
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed May 1, 2022
1 parent 7cf5da8 commit 4ea69f5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default defineNuxtModule<ModuleOptions>({
},
},
defaults: nuxt => ({
plugins: [nuxt.options.dev && '@harlem/plugin-devtools'].filter(Boolean),
plugins: [nuxt.options.dev && '@harlem/plugin-devtools'].filter(Boolean) as string[],
}),
setup(options, nuxt) {
const runtimeDir = fileURLToPath(new URL('./runtime', import.meta.url))
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ export default defineNuxtPlugin(nuxtApp => {
})

// Workaround until we have support in vueuse/head
if (process.server && 'renderMeta' in nuxtApp.ssrContext) {
if (process.server && nuxtApp.ssrContext && 'renderMeta' in nuxtApp.ssrContext) {
const originalRender = nuxtApp.ssrContext.renderMeta
nuxtApp.ssrContext.renderMeta = async () => {
const result = await originalRender()
const result = originalRender ? await originalRender() : {}
result.bodyScripts = (result.bodyScripts || '') + getBridgingScriptBlock()
return result
}
Expand Down

0 comments on commit 4ea69f5

Please sign in to comment.