slowpoke
slowpoke
SSolidJS
Created by slowpoke on 3/4/2024 in #support
SolidStart - Nitro Module missing `context` keys in `request`
Hey guys, I understand what I am asking about is likely out of scope, as this is dealing with a 3rd party package. However, with the stack I am unsure where to start asking questions. I'm seeing that SolidStart uses Vinxi + Nitro internally for the dev / build server. In order to better facilitate Cloudflare Pages local development, I've found the following package: nitro-cloudflare-dev, which is made for Nuxt and Nitro. Currently it seems Nitro does not natively support Worker bindings in local development, so this seems to be the next best thing. Thankfully, SolidStart's app.config.ts seems to expose Nitro config through the server: key, so I put modules: [nitroCloudflareBindings] in there to enable it. High level, the package seems to work by putting stuff into event.context.cloudflare. However, I'm seeing that when I try to make a middleware.ts for SolidStart, that event.context is not available. Instead, attempting to access event.nativeEvent.context does at least have a _nitro key in there, but nothing else. Also using the getEvent() from vinxi/server yields the same result - an empty .context key (except for _nitro). What can be done to resolve this? Perhaps the tool is now writing to the wrong key? Or perhaps Vinxi, Nitro, or Solid is dropping this .context.cloudflare key somewhere along the line? Thanks for any pointers!
2 replies