We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
event.context.nitro
- Operating System: Darwin - Node Version: v20.11.1 - Nuxt Version: 3.12.1 - CLI Version: 3.12.0 - Nitro Version: 2.10.0-28638494.93d002b7 - Package Manager: [email protected]
Live: https://7b85d7f1.nuxthub.pages.dev/ Faced on https://github.com/nuxt-hub/platform/pull/203
Deploying project to Cloudflare pages result undefined error because event.context.nitro is undefined.
I made a little patch that handles the undefined error. This might not be the correct solution for this issue but as a workaround it works fine
diff --git a/dist/runtime/internal/config.mjs b/dist/runtime/internal/config.mjs index f4314c748192ce0fe2fd72bb61de28fa8b70f1eb..c8c508297723568bbc1b817b14c89f1d691868a7 100644 --- a/dist/runtime/internal/config.mjs +++ b/dist/runtime/internal/config.mjs @@ -14,11 +14,12 @@ export function useRuntimeConfig(event) { if (!event) { return _sharedRuntimeConfig; } - if (event.context.nitro.runtimeConfig) { + if (event.context.nitro?.runtimeConfig) { return event.context.nitro.runtimeConfig; } const runtimeConfig = klona(_inlineRuntimeConfig); applyEnv(runtimeConfig, envOptions); + event.context.nitro = event.context.nitro || {}; event.context.nitro.runtimeConfig = runtimeConfig; return runtimeConfig; }
No response
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Environment
Reproduction
Live: https://7b85d7f1.nuxthub.pages.dev/
Faced on https://github.com/nuxt-hub/platform/pull/203
Describe the bug
Deploying project to Cloudflare pages result undefined error because
event.context.nitro
is undefined.I made a little patch that handles the undefined error. This might not be the correct solution for this issue but as a workaround it works fine
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: