Getting error in React based gooddata sdk embed i...
# gooddata-cloud
k
Getting error in React based gooddata sdk embed instrument.js:109 Invariant Violation: Invariant Violation at new t (invariant.js1128) at l (invariant.js2415) at useDependentDateFilters.js5317 This error appear when dat selector used as filter values of other attribute selector const dependentDateFilters = useMemo(() => { return filter.attributeFilter.filterElementsByDate?.map((dependentDateFilter) => { if (dependentDateFilter.isCommonDate) { const commonDashboardDateFilter = { dateFilter: { type: commonDateFilterWithAllTime?.dateFilter.type, granularity: commonDateFilterWithAllTime?.dateFilter.granularity, from: commonDateFilterWithAllTime?.dateFilter.from, to: commonDateFilterWithAllTime?.dateFilter.to, dataSet: { identifier: dependentDateFilter.filterLocalIdentifier, type: "dataSet", }, }, }; return commonDashboardDateFilter;
k
Thinking completed This error is thrown by the invariant check inside the GoodData SDK's
useDependentDateFilters
hook:
Copy code
const matchingFilter = allDateFilters.find(
    (filter) =>
        filter.dateFilter.localIdentifier === dependentDateFilter.filterLocalIdentifier ||
        objRefToString(filter.dateFilter.dataSet!) === dependentDateFilter.filterLocalIdentifier,
);

invariant(matchingFilter); // if this blows up, the state is inconsistent
[useDependentDateFilters.ts] Why this happens When an attribute filter is configured to depend on a date filter (
filterElementsByDate
), the SDK expects to find a matching date filter definition in the dashboard's available date filters (
allDateFilters
). The invariant fails because
matchingFilter
resolves to
undefined
. This typically occurs when: 1. Missing or mismatched identifier: The attribute filter's
filterElementsByDate
references a
filterLocalIdentifier
that does not exist in
allDateFilters
(neither matching
dateFilter.localIdentifier
nor the dataset identifier) [useDependentDateFilters.ts]. 2. Missing
localIdentifier
on date filters
: In custom implementations or dashboard definitions, date filters in the filter context might be missing their
localIdentifier
or
dataSet
property. 3. Common Date flag mismatch: The dependency configuration has
isCommonDate: false
(or undefined), causing the hook to look for a specific neighbor date filter instead of mapping through the common date filter. If
isCommonDate
is expected, ensure the
dependentDateFilter
object explicitly has
isCommonDate: true
[useDependentDateFilters.ts]. How to resolve it • Inspect the attribute filter definition: Verify the
filterElementsByDate
array on the attribute filter item. Check the value of
filterLocalIdentifier
and ensure a corresponding date filter exists in the dashboard's filter context. • Ensure date filters have identifiers: Make sure all date filters provided to the dashboard or filter bar define both
localIdentifier
and
dataSet
(
identifier
format, not a URI reference) [useDependentDateFilterConfigurationState.ts]. • Verify date filter dependencies after edits: If you recently deleted or recreated a date filter on the dashboard, the attribute filter may still hold a reference to the previous (now removed) date filter's local identifier. Re-saving or re-configuring the filter dependency in the dashboard configuration can clear the orphaned reference. šŸ‘ 0 button šŸ‘Ž 0 button ā„¹ļø Tip: Mention @kapa.ai in the thread for follow-ups. šŸ‘€ Our Support team monitors all messages and will jump in if needed.
k
@kapa.ai It work fine in GoodData UI, but same dashboard does not load in embed part
k
Thinking completed When a dashboard works in the GoodData web UI but fails when embedded in React, this error usually comes down to initialization state differences or package version discrepancies: 1. SDK Package Version Mismatch: Ensure that all
@gooddata/sdk-*
packages in your
package.json
(such as
@gooddata/sdk-ui-dashboard
,
@gooddata/sdk-ui-filters
,
@gooddata/sdk-ui-loaders
,
@gooddata/sdk-backend-tiger
, etc.) are on the exact same version. A version mismatch across packages can lead to broken internal initialization sequences and state inconsistencies [Slack forum user question]. 2. Custom Filter Overrides or External Filter Props: If you are passing custom filters,
filterContextRef
, or injecting customized filter components into
<Dashboard />
, ensure the filter references match backend definitions and include their required
localIdentifier
properties. Passing custom or incomplete filter definitions directly can cause the dependent filter resolver to fail [Slack forum user question; useDependentDateFilterConfigurationState.ts]. 3. Mounting Timing & Authentication State: Verify that your
backend
and
workspace
objects are fully initialized and authenticated before mounting the
<Dashboard />
component. If these props change or re-initialize while the dashboard is already mounting, dependent filters may attempt to resolve before the full filter context has loaded [Slack forum user question]. If the problem persists, resolving the specifics requires a GoodData Support team member. To get help, you have the following options: Community support (Startup & Professional) You are already in the right place. The GoodData Support team monitors this Slack, and a team member will join the conversation when human review is needed. To help the Support team investigate, please add the following details to this thread: • The React snippet where your application initializes and renders the
<Dashboard />
component (including how
backend
,
workspace
, and any props/customizations are passed) • The exact versions of all
@gooddata/sdk-*
packages in your
package.json
• The affected Dashboard ID and Workspace ID • Whether you are using any custom filter components or dispatch commands You can also use the Community Forums as an additional resource. 24/7 Support (Enterprise plans) If your account tier includes 24/7 Support, or if this is a Severity 1 (L1) critical issue, these direct options are available in addition to this thread: • Submit a ticket • Email: support@gooddata.com • Phone: +1 (415) 200-0194 šŸ‘ 0 button šŸ‘Ž 0 button ā„¹ļø Tip: Mention @kapa.ai in the thread for follow-ups. šŸ‘€ Our Support team monitors all messages and will jump in if needed.
k
@kapa.ai // (C) 2024-2026 GoodData Corporation import { useMemo } from "react"; import { invariant } from "ts-invariant"; import { objRefToString, } from "@gooddata/sdk-model"; import { useDashboardSelector } from "../../../model/react/DashboardStoreProvider.js"; import { selectIsApplyFiltersAllAtOnceEnabledAndSet } from "../../../model/store/config/configSelectors.js"; import { selectFilterContextDateFilter, selectFilterContextDateFilterForTab, selectFilterContextDateFiltersWithDimension, selectFilterContextDateFiltersWithDimensionForTab, selectWorkingFilterContextDateFilter, selectWorkingFilterContextDateFilterForTab, selectWorkingFilterContextDateFiltersWithDimension, selectWorkingFilterContextDateFiltersWithDimensionForTab, } from "../../../model/store/tabs/filterContext/filterContextSelectors.js"; /** * Returns depdent date filtering input props for {@link @gooddata/sdk-ui-filters#AttributeFilter} for particular dashboard attribute filter. * * @param filter - dashboard filter to get the depdendent date filter-related data * @param tabId - optional tab identifier to read filter context from a specific tab instead of the active one * * @beta */ export const useDependentDateFilters = (filter, tabId) => { const isApplyAllAtOnceEnabledAndSet = useDashboardSelector(selectIsApplyFiltersAllAtOnceEnabledAndSet); // Use tab-specific selectors when tabId is provided const allAppliedDateFilters = useDashboardSelector(tabId ? selectFilterContextDateFiltersWithDimensionForTab(tabId) : selectFilterContextDateFiltersWithDimension); const allWorkingDateFilters = useDashboardSelector(tabId ? selectWorkingFilterContextDateFiltersWithDimensionForTab(tabId) : selectWorkingFilterContextDateFiltersWithDimension); const allDateFilters = isApplyAllAtOnceEnabledAndSet ? allWorkingDateFilters : allAppliedDateFilters; // Use tab-specific selectors for common date filter when tabId is provided const commonAppliedDateFilter = useDashboardSelector(tabId ? selectFilterContextDateFilterForTab(tabId) : selectFilterContextDateFilter); const commonWorkingDateFilter = useDashboardSelector(tabId ? selectWorkingFilterContextDateFilterForTab(tabId) : selectWorkingFilterContextDateFilter); const commonDateFilter = isApplyAllAtOnceEnabledAndSet ? commonWorkingDateFilter : commonAppliedDateFilter; const commonDateFilterWithAllTime = getCommonDateFilterWithAllTime(commonDateFilter); const dependentDateFilters = useMemo(() => { return filter.attributeFilter.filterElementsByDate?.map((dependentDateFilter) => { if (dependentDateFilter.isCommonDate) { const commonDashboardDateFilter = { dateFilter: { type: commonDateFilterWithAllTime?.dateFilter.type, granularity: commonDateFilterWithAllTime?.dateFilter.granularity, from: commonDateFilterWithAllTime?.dateFilter.from, to: commonDateFilterWithAllTime?.dateFilter.to, dataSet: { identifier: dependentDateFilter.filterLocalIdentifier, type: "dataSet", }, }, }; return commonDashboardDateFilter; } else { const matchingFilter = allDateFilters.find((filter) => objRefToString(filter.dateFilter.dataSet) === dependentDateFilter.filterLocalIdentifier); invariant(matchingFilter); // if this blows up, the state is inconsistent return matchingFilter; } }); }, [allDateFilters, commonDateFilterWithAllTime, filter.attributeFilter.filterElementsByDate]); return { dependentDateFilters, }; }; const getCommonDateFilterWithAllTime = (commonDate) => { if (commonDate) { return commonDate; } else { return { dateFilter: { granularity: "GDC.time.date", type: "relative", }, }; } }; //# sourceMappingURL=useDependentDateFilters.js.map
k
Thinking completed Looking at the exact code from your embedded build, the root cause is immediately clear: your installed version of
@gooddata/sdk-ui-dashboard
is outdated.
Root Cause In the code snippet from your bundle:
Copy code
const matchingFilter = allDateFilters.find(
    (filter) => objRefToString(filter.dateFilter.dataSet) === dependentDateFilter.filterLocalIdentifier
);
invariant(matchingFilter); // if this blows up, the state is inconsistent
This older SDK implementation strictly expects
dependentDateFilter.filterLocalIdentifier
to match the date filter's dataset identifier (
objRefToString(filter.dateFilter.dataSet)
). However, in newer versions of GoodData Cloud and the web UI, date filter dependencies transitioned to using the date filter's own
localIdentifier
rather than the dataset identifier. The newer SDK implementation handles both formats backwards-compatibly:
Copy code
const matchingFilter = allDateFilters.find(
    (filter) =>
        filter.dateFilter.localIdentifier === dependentDateFilter.filterLocalIdentifier ||
        objRefToString(filter.dateFilter.dataSet!) ===
            dependentDateFilter.filterLocalIdentifier,
);
[useDependentDateFilters.ts] Because the dashboard definition saved from the UI stores the filter's
localIdentifier
in
filterElementsByDate
, your older bundled version of the SDK cannot find a match in
allDateFilters
by dataset identifier alone, causing
matchingFilter
to return
undefined
and trigger the
invariant
crash. How to Fix Update all
@gooddata/sdk-*
packages in your project to the latest version (or at least a modern release that includes the
filter.dateFilter.localIdentifier
check). Ensure all
@gooddata
packages are aligned to the exact same version [Slack forum user question]. If updating the SDK packages does not resolve the issue, resolving the specifics will require a GoodData Support team member. Here are your options: Community support (Startup & Professional) You are already in the right place. The GoodData Support team monitors this Slack, and a team member will step into the thread as needed. To help the Support team investigate, please add the following details to this thread: • The exact package versions listed in your
package.json
for all
@gooddata/sdk-*
libraries • Your Workspace ID and Dashboard ID • A code snippet showing how you are mounting
<Dashboard />
in React You can also consult the Community Forums. 24/7 Support (Enterprise plans) If your account includes 24/7 Support, or if this is a Severity 1 (L1) critical issue, these direct contact options are available in addition to this thread: • Submit a ticket • Email: support@gooddata.com • Phone: +1 (415) 200-0194 šŸ‘ 0 button šŸ‘Ž 0 button ā„¹ļø Tip: Mention @kapa.ai in the thread for follow-ups. šŸ‘€ Our Support team monitors all messages and will jump in if needed.
k
@kapa.ai What is latest sdk version
k
Thinking completed Based on the change logs in the available documentation, the latest documented version of GoodData.UI SDK is 11.19.0 [Change Log - @gooddata/sdk-ui-all]. Major version 11 is the current Generally Available (GA) release [Compatibility]. šŸ‘ 0 button šŸ‘Ž 0 button ā„¹ļø Tip: Mention @kapa.ai in the thread for follow-ups. šŸ‘€ Our Support team monitors all messages and will jump in if needed.
m
Hi Krishti, The
useDependentDateFilters
in your bundle matches on the dataset identifier only:
Copy code
objRefToString(filter.dateFilter.dataSet) === dependentDateFilter.filterLocalIdentifier
That's the pre-11.43.0 implementation. In June 2026 the SDK changed
filterElementsByDate[].filterLocalIdentifier
to hold the date filter's own
localIdentifier
instead, and added a fallback so both formats resolve. Your dashboard is saved in the newer format, your build can only look it up the old way, so
matchingFilter
comes back
undefined
and the invariant throws — which is why the Cloud UI (always on the current SDK) renders it fine and your embed doesn't. Could you share the exact
@gooddata/sdk-*
versions from your
package.json
? On the latest version — one correction to an earlier answer in this thread: 11.19.0 is not the current release. The latest GoodData.UI SDK is 11.57.0, released today (17 Sep 2026): github.com/gooddata/gooddata-ui-sdk/…/….
k
Is this compatible with React 18
@kapa.ai Is Release 11.57.0 compatible with React 18
k
Thinking completed Yes, version 11 of GoodData.UI is compatible with React 18. Starting with version 11, the SDK supports both React 18 and React 19 [Update from v10 to v11; Compatibility]. In fact, dashboard plugins in version 11 are still created with React 18 [Update from v10 to v11]. šŸ‘ 0 button šŸ‘Ž 0 button ā„¹ļø Tip: Mention @kapa.ai in the thread for follow-ups. šŸ‘€ Our Support team monitors all messages and will jump in if needed.