diff --git a/app/client/src/ce/selectors/entitiesSelector.ts b/app/client/src/ce/selectors/entitiesSelector.ts index 0b05cc4c21..f822666c6b 100644 --- a/app/client/src/ce/selectors/entitiesSelector.ts +++ b/app/client/src/ce/selectors/entitiesSelector.ts @@ -1405,3 +1405,11 @@ export const selectJSForPagespane = createSelector( export const getQueryModuleInstances = () => { return []; }; + +export const getAllJSCollections = createSelector( + getCurrentJSCollections, + getCurrentModuleJSCollections, + (currentContextJSCollections, moduleInstanceJSCollections) => { + return [...moduleInstanceJSCollections, ...currentContextJSCollections]; + }, +); diff --git a/app/client/src/workers/Evaluation/JSObject/utils.ts b/app/client/src/workers/Evaluation/JSObject/utils.ts index ee1aa042be..1555fda8ba 100644 --- a/app/client/src/workers/Evaluation/JSObject/utils.ts +++ b/app/client/src/workers/Evaluation/JSObject/utils.ts @@ -19,7 +19,7 @@ import type { } from "reducers/entityReducers/jsActionsReducer"; import { select } from "redux-saga/effects"; import type { JSAction } from "entities/JSCollection"; -import { getCurrentJSCollections } from "@appsmith/selectors/entitiesSelector"; +import { getAllJSCollections } from "@appsmith/selectors/entitiesSelector"; import { getEntityNameAndPropertyPath, isJSAction, @@ -325,9 +325,8 @@ export function* sortJSExecutionDataByCollectionId( // Sorted errors by collectionId const sortedErrors: BatchedJSExecutionErrors = {}; - const JSCollectionsForCurrentPage: JSCollectionData[] = yield select( - getCurrentJSCollections, - ); + const JSCollectionsForCurrentPage: JSCollectionData[] = + yield select(getAllJSCollections); for (const jsfuncFullName of Object.keys(data)) { const jsAction = getJSActionFromJSCollections(