Closed fabb closed 7 months ago
@fabb , Thanks for the early report. I need to add e2e SSR test. Grrrr. That's on me.
I created a work ticket (FSSDK-9975) for a short turnaround.
@mikechu-optimizely Sorry to nudge, but I don't suppose you have an ETA on this fix? It's a blocker to upgrading to v3, which itself seems to be required for the library to work with the Next.js App Router.
Hey. Thanks for the nudge.
This ticket got bumped for a severity 1 to keep the sprint points level, but grrr it got put into Planning instead of just bumped forward a sprint.
I've pulled it into next week's sprint start.
@mikechu-optimizely how is progress going?
Hi @fabb. I'm working to get #255 approved.
Hi again @fabb Can you review v3.1.0 in your implementation?
@mikechu-optimizely thank you, it works now correctly!
Woot w00t. 🎉 Thanks for the collab.
Is there an existing issue for this?
SDK Version
3.0.0
Current Behavior
I have an
OptimizelyProvider
in a'use client'
component that is SSRed. It receives the user directly on the initial render.In another
'use client'
component that is SSRed, I useuseDecision
withautoUpdate:false
.The output of
useDecision
is an error: "Unable to evaluate feature "..." because User ID is not set."Expected Behavior
Since the
OptimizelyProvider
receives the user directly during SSR, I would expect thatuseDecision
already contains the correct decision for that user, and the according variant can be server rendered.Steps To Reproduce
Might be related to https://github.com/optimizely/react-sdk/issues/185
React Framework
next.js 14.0.4
Browsers impacted
all
Link
No response
Logs
No response
Severity
Blocking development
Workaround/Solution
none found yet except for
autoUpdate:true
which I want to avoid since the SSR result should already be the correct variant.Recent Change
I think it was not an issue in the previous major version, but I only tried it in another project, because the current project is new.
Conflicts
No response