Skip to content

Commit f94081b

Browse files
authored
improve: Update module meta and fix undefined error (#235)
* improve: Update module meta and fix undefined error * update-module-meta: Add optional chaining
1 parent 36d125a commit f94081b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export default defineNuxtModule<ModuleOptions>({
2626
name: 'nuxtjs-drupal-ce',
2727
configKey: 'drupalCe',
2828
compatibility: {
29-
nuxt: '^3.2.2',
29+
nuxt: '^3.7.0',
3030
},
3131
},
3232
defaults: {

src/runtime/composables/useDrupalCe/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export const useDrupalCe = () => {
6565
const useCeApi = (path: string | Ref<string>, fetchOptions: UseFetchOptions<any> = {}, doPassThroughHeaders?: boolean): Promise<any> => {
6666
const nuxtApp = useNuxtApp()
6767
fetchOptions.onResponse = (context) => {
68-
if (doPassThroughHeaders && privateConfig.passThroughHeaders && import.meta.server) {
68+
if (doPassThroughHeaders && import.meta.server && privateConfig?.passThroughHeaders) {
6969
const headersObject = Object.fromEntries([...context.response.headers.entries()])
7070
passThroughHeaders(nuxtApp, headersObject)
7171
}
@@ -221,7 +221,7 @@ export const useDrupalCe = () => {
221221
const event = nuxtApp.ssrContext.event
222222
if (pageHeaders) {
223223
Object.keys(pageHeaders).forEach((key) => {
224-
if (privateConfig.passThroughHeaders.includes(key)) {
224+
if (privateConfig?.passThroughHeaders.includes(key)) {
225225
appendResponseHeader(event, key, pageHeaders[key])
226226
}
227227
})

0 commit comments

Comments
 (0)