nksaraf / vinxi

The Full Stack JavaScript SDK
https://vinxi.vercel.app
MIT License
1.33k stars 56 forks source link

TypeError: Cannot read properties of undefined (reading 'config') when turning on experimental.asyncContext option #235

Closed FlatMapIO closed 4 months ago

FlatMapIO commented 4 months ago

It works fine in development mode, but when deployed in all three cf vercel-edge nodejs targets it causes problems, and I finally managed to locate the error in the local nodejs target.

image
!globalThis.app.config.server.experimental?.asyncContext) throw new Error("AsyncLocalStorage was not enabled. Use the `server.experimental.asyncContext: true` option in your app configuration to enable it. Or, pass the instance of HTTPEvent that you have as the first argument to the function."

Among other things, the runtimeConfig, dev other options in solid-start do not generate accessible properties at runtime after configuration.

FlatMapIO commented 4 months ago

rel #233

nksaraf commented 4 months ago

Can you make a github repo that reproduces this. I can try deploying it to vercel-edge

FlatMapIO commented 4 months ago

Sorry @nksaraf , I took the time to look into it, and there is a global scope reference to getEvent. That was my mistake.