Description
Is there an existing issue for this?
- I have searched the existing issues
SDK Version
5.3.0
Current Behavior
const optimizelyUserContext = optimizelyClient.createUserContext(userId, udo);
leads to
ReferenceError setTimeout is not defined ReferenceError: setTimeout is not defined%0A at e.onReady (main.js:1:84427)%0A at new e (main.js:1:28336)%0A at e.createUserContext (main.js:1:84961)%0A at main.js:1:93456%0A at Generator.next ()%0A at main.js:1:461%0A at new Promise ()%0A at a (main.js:1:206)%0A at jr (main.js:1:92339)
Expected Behavior
Works same as before
Steps To Reproduce
- In Akamai Edge Env
- Run your starter kit https://github.com/optimizely/akamai-edgeworker-starter-kit with 5.3.0
SDK Type
Edge/Lite
Node Version
No response
Browsers impacted
No response
Link
No response
Logs
No response
Severity
No response
Workaround/Solution
The cause of this behavior I think is: calling onReady
because stack trace pointed to this
javascript-sdk/lib/optimizely/index.ts
Line 1407 in 75418da
I can see that you pass shouldIdentifyUser as true to createUserContext all the time.
And another function shouldIdentifyUser as false createInternalUserContext, is private, so for the time being is it ok to use createInternalUserContext and to suppress typescript?
This approach works fine
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
const optimizelyUserContext = optimizelyClient.createInternalUserContext(userId, udo);
Recent Change
No response
Conflicts
No response