Cannot read property 'currentHierarchyNodeId' of undefined

This error occurs when you use createLabelQueryWidget but you did not pass renderer as an argument. To fix this error, debug the error and make sure you pass the renderer besides the sourceNode.

JavaScript

configureAsInlineAnchorToStructure(sxModule, 'self::fn', t('footnote'), {
    contextualOperations: [
        { name: ':contextual-insert-label--automatic' },
        { name: ':contextual-renumber-fn' }
    ],
    defaultTextContainer: 'p',
    createInnerJsonMl: function(sourceNode, renderer) {
        return [
            'cv-content',
            { 'cv-baseline': 'superscript' },
            createLabelQueryWidget('./label', { inline: true })(
                sourceNode,
                // Make sure to pass the renderer when using this widget in another widget or object:
                renderer
            )
        ];
     }
});