I’m using the @atlaskit/page-layout
component in my (non-Atlassian) app and have just upgraded from 1.3.x
to 4.2.x
, so I couldn’t really say when this was introduced, but I noticed that I get a warning in my console about a feature gate check.
{
"msg": "An error has occurred checking the feature gate. Only the first occurrence of this error is logged.",
"gateName": "platform-visual-refresh-icons",
"error": {
"message": "Client must be initialized before using this method",
"stack": "
Error: Client must be initialized before using this method
at Client2.assertInitialized
at Client2.checkGate
at FeatureGates2.checkGate
at resolveBooleanFlag
at fg
at Icon2
at renderWithHooks
at updateFunctionComponent
at updateSimpleMemoComponent
at updateMemoComponent
"
}
Firstly, I’ll of course acknowledge that I know this is safe to ignore, and actually kudos to putting in a limit to how often this is logged.
When a warning is shown in the developer console, for something that I cannot action, it makes the warning useless, and it would be better if it wasn’t shown.
In this case, the error was that the StatSig
client that is used in AFP for managing feature gates was not initialized.
I dug around in the AFP codebase and figured out that as a workaround I can put the following code in one of my application’s root files:
window.__CRITERION__ = { getFeatureFlagOverride: () => false };
Hopefully, the AFP team could augment this code so that it only warns in Atlassian ecosystem contexts, and not outside of it.
In the meantime, if anyone else runs into this problem, hopefully they’ll stumble upon this post and find the workaround.