You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I recently ran into a problem with using static web apps azure adapter.
Each request to azure function (backend of the app) is accompanied with an invocation context, which holds methods (v3) or object (v4) to log. Adapter puts it to the event.platform, which is fine and expected.
With the .server.ts it's all pretty clear, the event.locals would hold the logger, which is bound to event.platform. But in the universal function during the SSR there is no way to access that logger (except singletons)
So if an error happens in the universal function in SSR mode, there is no way to report it (beside sentry, for example), console.log methods are ignored by the azure functions.
It would be nice to have the locals and platform available (as optionals) to the universal load in the SSR mode, if that makes sense.
Thank you very much in advance!
Describe the proposed solution
Optionals event.locals & event.platform when SSR is running.
Alternatives considered
TLDR: pain & singletons
hooks.server.ts
...
event.locals.logger=newLogger(...)setSSRRequestLogger(requestId,logger);// These are flushed and deleted periodically e.g. each 5 secs
...
root +layout.server.ts
...
return{
requestId,
correlationId,}
root +layout.ts
if(browser){return{
some data}}else{return{
somedata,requestId: event.data.requestId,correlationId: event.data.correlationId}}
Describe the problem
Hi, I recently ran into a problem with using static web apps azure adapter.
Each request to azure function (backend of the app) is accompanied with an invocation context, which holds methods (v3) or object (v4) to log. Adapter puts it to the event.platform, which is fine and expected.
With the .server.ts it's all pretty clear, the event.locals would hold the logger, which is bound to event.platform. But in the universal function during the SSR there is no way to access that logger (except singletons)
So if an error happens in the universal function in SSR mode, there is no way to report it (beside sentry, for example), console.log methods are ignored by the azure functions.
It would be nice to have the locals and platform available (as optionals) to the universal load in the SSR mode, if that makes sense.
Thank you very much in advance!
Describe the proposed solution
Optionals event.locals & event.platform when SSR is running.
Alternatives considered
TLDR: pain & singletons
hooks.server.ts
root +layout.server.ts
root +layout.ts
child +layout.ts
Importance
would make my life easier
Additional Information
No response
The text was updated successfully, but these errors were encountered: