diff --git a/frontend/package.json b/frontend/package.json index 57785151d3..3034d57e39 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -267,4 +267,4 @@ "jsx" ] } -} +} \ No newline at end of file diff --git a/frontend/src/AppBuilder/CodeEditor/useQueryPanelKeyHooks.js b/frontend/src/AppBuilder/CodeEditor/useQueryPanelKeyHooks.js index 1a41a7f19b..b5f549a354 100644 --- a/frontend/src/AppBuilder/CodeEditor/useQueryPanelKeyHooks.js +++ b/frontend/src/AppBuilder/CodeEditor/useQueryPanelKeyHooks.js @@ -7,7 +7,14 @@ export const useQueryPanelKeyHooks = (onChange, value, type) => { const queryPanelHeight = useStore((state) => state.queryPanel.queryPanelHeight); const runQueryOnShortcut = useStore((state) => state.queryPanel.runQueryOnShortcut); const previewQueryOnShortcut = useStore((state) => state.queryPanel.previewQueryOnShortcut); - const moduleId = useModuleId(); + + // Handle case where ModuleContext is not available + let moduleId; + try { + moduleId = useModuleId(); + } catch (error) { + moduleId = 'canvas'; // Default fallback + } const location = useLocation(); const { pathname } = location;