Hi, got an error, I haven’t seen before… bundle.j...
# gooddata-ui
m
Hi, got an error, I haven’t seen before… bundle.js:365368 Uncaught Invariant Violation: dangling localId reference. Target: m_fact.re_all_secure.list_price_avg at new InvariantError (https://localhost:3000/static/js/bundle.js:365368:24) at Module.invariant (https://localhost:3000/static/js/bundle.js:365378:11) at Normalizer.normalizedLocalId (https://localhost:3000/static/js/bundle.js:51201:29) at https://localhost:3000/static/js/bundle.js:51308:41 at Array.forEach (<anonymous>) at Normalizer.normalizeFilters (https://localhost:3000/static/js/bundle.js:51304:32) at Normalizer.normalize (https://localhost:3000/static/js/bundle.js:51357:13) at Normalizer.normalize (https://localhost:3000/static/js/bundle.js:51385:14) at NormalizingPreparedExecution._this.execute (https://localhost:3000/static/js/bundle.js:50857:56) at base_1.useCancelablePromise.promise (https://localhost:3000/static/js/bundle.js:122225:24) Happens after doing a useExecutionDataView and the filter has attributes and measures (value between x and y) filters. Any ideas what’s causing the issue?
d
Hi Michael, this error may point to some inconsistency in the execution you are trying to run. Can you please share how you are calling the hook? For more context, this error means that we failed to resolve a local id reference between some of the objects you are using to define the execution (for example measure value filter pointing to a measure that is not there, or arithmetic measure doing the same, or something similar).
For the particular error message you sent, it seems that there is no object with localId of
<http://m_fact.re|m_fact.re>_all_secure.list_price_avg
in your execution and some other object is trying to reference it.
m
Hi @Dan Homola I tried that too that if I pass a measure value filter, I need to pass the measure as seriesBy in the useExecutionDataView. I worked with @Matyáš Kandl to make a custom filter that only show possible values in the dataset. Filters in are in a context, that cascades to each attribute filter. // Query for possible values const { result } = useExecutionDataView( { execution: { seriesBy, slicesBy, filters: currentFilter }, }, [currentFilter], ); // Make stateElements for AttributeFilterButton const staticElements = useMemo( () => result ?.meta() .allHeaders()[0][0] // @ts-ignore .map((m) => ({ title: m?.attributeHeaderItem?.name, uri: m?.attributeHeaderItem?.uri })) ?? [], [result], );
d
Yes you definitely need to pass the “source” measure of the measure value filter in the execution as well, we do not support filtering by things not included in the execution.
m
Yes, makes sense, something to learn and be mindful about. But attributes are not needed in the slicesBy. Only if a measure is passed as filter then it needs to be also in the seriesBy (The normalization should align that automatically?) Thanks for the tips, helps me confirm what’s going wrong, I only have one filter out of 15 giving the error now, almost there!
d
You are correct, the attributes that are sued in attribute filter to filter by do not have to be included in the execution themselves (because they are not referenced by localId, but by identifier). Measures on the other hand are referenced by localId (by measure value filters and derived measures: arithmetic, previous period and period over period measures) and therefore need to be in the execution themselves as well. I hope it makes things a bit clearer 🙂 and I’m glad you are making progress!