-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
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
fix(wrangler): only set environment if defined #49
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me 🙂
but...
I am not very familiar with the nuxt/nuxthub codebases, but (and sorry for being potentially annoying 😅) I feel that if this issue is caused by having runtimeConfig.wrangler.environment === ''
then the real problem if somewhere up the stack, as runtimeConfig.wrangler.environment
should not be set to an empty string, do you by any chance know where this happens and why?
@@ -90,7 +90,7 @@ async function nitroModule(nitro: Nitro) { | |||
// Dual compatibility with Nuxt and Nitro Modules | |||
export default function nitroCloudflareDev(arg1: unknown, arg2: unknown) { | |||
if ((arg2 as Nuxt)?.options?.nitro) { | |||
(arg2 as Nuxt).hooks.hook("nitro:config", (nitroConfig) => { | |||
(arg2 as Nuxt).hooks.hookOnce("nitro:config", (nitroConfig) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some idea: unjs/hookable#105
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! It is likely an upstream issue, but looks nice hotfix.
Followup: #51
resolves nuxt-hub/core#331
I noticed that using
experiment.inlineRouteRules: true
create this issue for wrangler, making the bindings unavailable:When setting the flag, it seems the
runtimeConfig.wrangler.environment === ''
and the platform proxy does not like it, I updated so it is given only if set.I also move from
hook
tohookOnce
to avoid keeping a watcher.