langflow icon indicating copy to clipboard operation
langflow copied to clipboard

can't import json using examples or local

Open developerisnow opened this issue 2 years ago • 4 comments

Describe the bug

BUG-1:

While trying to import json from examples OR from localhost in console.log I see error.

caught (in promise) TypeError: Cannot read properties of undefined (reading 'template')
    at tabsContext.tsx:171:1
    at Array.forEach (<anonymous>)
    at addFlow (tabsContext.tsx:170:1)
    at tabsContext.tsx:131:1
(

I tried before https://github.com/logspace-ai/langflow/issues/275#issuecomment-1543329427

Browser and Version

  • Browser Macos, Brave
  • Server ubuntu 22.04 LTS

To Reproduce Steps to reproduce the behavior:

  1. Go to frontend
  2. Click on 'Import JSON'
  3. Choose to Example or Local
  4. See error

Screenshots Here is gif-video illustration of the bug https://i.gyazo.com/eba533d83c879b7e1ee7e4c7ffc11cf3.mp4

BUG-2 Frontend fail after Backend fix.

should fix by this https://github.com/logspace-ai/langflow/issues/275#issuecomment-1543329427

but if I solve this https://github.com/logspace-ai/langflow/issues/275#issuecomment-1543329427 - it gives FRONTEND FAIL

developerisnow avatar May 11 '23 04:05 developerisnow

if I change port like this https://github.com/logspace-ai/langflow/issues/275#issuecomment-1543329427 it makes my frontend http://:3000 white screen, but backend works 200.

docker-compose logs frontend -f:

...
langflow-frontend-1  |   Line 68:4:  'descriptionFontSize' is assigned a value but never used  @typescript-eslint/no-unused-vars
langflow-frontend-1  | 
langflow-frontend-1  | src/modals/importModal/index.tsx
langflow-frontend-1  |   Line 4:3:    'ArrowDownTrayIcon' is defined but never used  @typescript-eslint/no-unused-vars
langflow-frontend-1  |   Line 15:10:  'error' is defined but never used              @typescript-eslint/no-unused-vars
langflow-frontend-1  | 
langflow-frontend-1  | src/modals/promptModal/index.tsx
langflow-frontend-1  |   Line 17:10:  'dark' is assigned a value but never used  @typescript-eslint/no-unused-vars
langflow-frontend-1  | 
langflow-frontend-1  | src/pages/FlowPage/components/extraSidebarComponent/index.tsx
langflow-frontend-1  |   Line 4:22:  'useEffect' is defined but never used  @typescript-eslint/no-unused-vars
langflow-frontend-1  |   Line 4:33:  'useState' is defined but never used   @typescript-eslint/no-unused-vars
langflow-frontend-1  | 
langflow-frontend-1  | src/pages/FlowPage/components/tabsManagerComponent/index.tsx
langflow-frontend-1  |   Line 1:33:   'useState' is defined but never used               @typescript-eslint/no-unused-vars
langflow-frontend-1  |   Line 22:49:  'uploadFlow' is assigned a value but never used    @typescript-eslint/no-unused-vars
langflow-frontend-1  |   Line 22:61:  'downloadFlow' is assigned a value but never used  @typescript-eslint/no-unused-vars
langflow-frontend-1  | 
langflow-frontend-1  | src/pages/FlowPage/index.tsx
langflow-frontend-1  |   Line 13:3:   'useKeyPress' is defined but never used                                                                                                  @typescript-eslint/no-unused-vars
langflow-frontend-1  |   Line 17:3:   'OnNodesDelete' is defined but never used                                                                                                @typescript-eslint/no-unused-vars
langflow-frontend-1  |   Line 46:11:  'undo' is assigned a value but never used                                                                                                @typescript-eslint/no-unused-vars
langflow-frontend-1  |   Line 46:17:  'redo' is assigned a value but never used                                                                                                @typescript-eslint/no-unused-vars
langflow-frontend-1  |   Line 46:23:  'canUndo' is assigned a value but never used                                                                                             @typescript-eslint/no-unused-vars
langflow-frontend-1  |   Line 46:32:  'canRedo' is assigned a value but never used                                                                                             @typescript-eslint/no-unused-vars
langflow-frontend-1  |   Line 264:5:  React Hook useCallback has a missing dependency: 'getId'. Either include it or remove the dependency array                               react-hooks/exhaustive-deps
langflow-frontend-1  |   Line 287:5:  React Hook useCallback has missing dependencies: 'reactFlowInstance' and 'setEdges'. Either include them or remove the dependency array  react-hooks/exhaustive-deps
langflow-frontend-1  |   Line 296:7:  React Hook useCallback has a missing dependency: 'setEdges'. Either include it or remove the dependency array                            react-hooks/exhaustive-deps
langflow-frontend-1  | 
langflow-frontend-1  | src/utils.ts
langflow-frontend-1  |   Line 21:27:  'TemplateVariableType' is defined but never used  @typescript-eslint/no-unused-vars
langflow-frontend-1  | 
langflow-frontend-1  | Search for the keywords to learn more about each warning.
langflow-frontend-1  | To ignore, add // eslint-disable-next-line to the line before.
langflow-frontend-1  | 
langflow-frontend-1  | WARNING in ./node_modules/ace-builds/src-noconflict/worker-coffee.js (./node_modules/file-loader/dist/cjs.js?esModule=false!./node_modules/ace-builds/src-noconflict/worker-coffee.js)
langflow-frontend-1  | Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
langflow-frontend-1  | Failed to parse source map from 'data:application/json;base64,': SyntaxError: Unexpected end of JSON input
langflow-frontend-1  | 
langflow-frontend-1  | WARNING in [eslint] 
langflow-frontend-1  | src/App.tsx
langflow-frontend-1  |   Line 112:29:  'window.location.href' is assigned to itself                                                                                                                                           no-self-assign
langflow-frontend-1  |   Line 158:4:   Using target="_blank" without rel="noreferrer" (which implies rel="noopener") is a security risk in older browsers: see https://mathiasbynens.github.io/rel-noopener/#recommendations  react/jsx-no-target-blank
langflow-frontend-1  | 
langflow-frontend-1  | src/CustomNodes/GenericNode/index.tsx
langflow-frontend-1  |   Line 42:6:   React Hook useEffect has a missing dependency: 'reactFlowInstance'. Either include it or remove the dependency array  react-hooks/exhaustive-deps
langflow-frontend-1  |   Line 44:24:  React Hook useCallback received a function whose dependencies are unknown. Pass an inline function instead            react-hooks/exhaustive-deps
langflow-frontend-1  | 
langflow-frontend-1  | src/alerts/alertDropDown/index.tsx
langflow-frontend-1  |   Line 1:22:  'useEffect' is defined but never used  @typescript-eslint/no-unused-vars
langflow-frontend-1  |   Line 9:39:  Unexpected empty object pattern        no-empty-pattern
langflow-frontend-1  | 
langflow-frontend-1  | src/alerts/error/index.tsx
langflow-frontend-1  |   Line 2:23:  'XMarkIcon' is defined but never used  @typescript-eslint/no-unused-vars
langflow-frontend-1  | 
langflow-frontend-1  | src/alerts/notice/index.tsx
langflow-frontend-1  |   Line 2:33:  'XMarkIcon' is defined but never used  @typescript-eslint/no-unused-vars
langflow-frontend-1  | 
langflow-frontend-1  | src/alerts/success/index.tsx
langflow-frontend-1  |   Line 2:27:  'XMarkIcon' is defined but never used  @typescript-eslint/no-unused-vars
langflow-frontend-1  | 
langflow-frontend-1  | src/components/ExtraSidebarComponent/index.tsx
langflow-frontend-1  |   Line 2:10:  'ChevronLeftIcon' is defined but never used            @typescript-eslint/no-unused-vars
langflow-frontend-1  |   Line 12:5:  'setIsStackedOpen' is assigned a value but never used  @typescript-eslint/no-unused-vars
langflow-frontend-1  | 
langflow-frontend-1  | src/components/TooltipComponent/index.tsx
langflow-frontend-1  |   Line 1:10:  'ReactElement' is defined but never used  @typescript-eslint/no-unused-vars
langflow-frontend-1  | 
langflow-frontend-1  | src/components/chatComponent/chatTrigger/index.tsx
langflow-frontend-1  |   Line 2:10:  'Bars3CenterLeftIcon' is defined but never used  @typescript-eslint/no-unused-vars
langflow-frontend-1  |   Line 6:8:   'ChatModal' is defined but never used            @typescript-eslint/no-unused-vars
langflow-frontend-1  |   Line 9:12:  'openPopUp' is assigned a value but never used   @typescript-eslint/no-unused-vars
langflow-frontend-1  | 
langflow-frontend-1  | src/components/chatComponent/index.tsx
langflow-frontend-1  |   Line 1:21:  'useRef' is defined but never used           @typescript-eslint/no-unused-vars
langflow-frontend-1  |   Line 3:10:  'ChatMessageType' is defined but never used  @typescript-eslint/no-unused-vars
langflow-frontend-1  |   Line 7:7:   '_' is assigned a value but never used       @typescript-eslint/no-unused-vars
langflow-frontend-1  | 
langflow-frontend-1  | src/components/codeAreaComponent/index.tsx
langflow-frontend-1  |   Line 5:8:  'TextAreaModal' is defined but never used  @typescript-eslint/no-unused-vars
langflow-frontend-1  | 
langflow-frontend-1  | src/components/inputFileComponent/index.tsx
langflow-frontend-1  |   Line 22:5:  React Hook useEffect has a missing dependency: 'onFileChange'. Either include it or remove the dependency array. If 'onFileChange' changes too often, find the parent component that defines it and wrap that definition in useCallback  react-hooks/exhaustive-deps
langflow-frontend-1  | 
langflow-frontend-1  | src/components/promptComponent/index.tsx
langflow-frontend-1  |   Line 4:8:  'CodeAreaModal' is defined but never used  @typescript-eslint/no-unused-vars
langflow-frontend-1  |   Line 5:8:  'TextAreaModal' is defined but never used  @typescript-eslint/no-unused-vars
langflow-frontend-1  | 
langflow-frontend-1  | src/contexts/tabsContext.tsx
langflow-frontend-1  |   Line 11:10:  'normalCaseToSnakeCase' is defined but never used                                                        @typescript-eslint/no-unused-vars
langflow-frontend-1  |   Line 11:33:  'updateObject' is defined but never used                                                                 @typescript-eslint/no-unused-vars
langflow-frontend-1  |   Line 14:27:  'TemplateVariableType' is defined but never used                                                         @typescript-eslint/no-unused-vars
langflow-frontend-1  |   Line 57:6:   React Hook useEffect has a missing dependency: 'save'. Either include it or remove the dependency array  react-hooks/exhaustive-deps
langflow-frontend-1  | 
langflow-frontend-1  | src/modals/chatModal/chatMessage/index.tsx
langflow-frontend-1  |   Line 26:26:  img elements must have an alt prop, either with meaningful text, or an empty string for decorative images  jsx-a11y/alt-text
langflow-frontend-1  | 
langflow-frontend-1  | src/modals/chatModal/index.tsx
langflow-frontend-1  |   Line 4:3:     'LockClosedIcon' is defined but never used                                                                               @typescript-eslint/no-unused-vars
langflow-frontend-1  |   Line 5:3:     'PaperAirplaneIcon' is defined but never used                                                                            @typescript-eslint/no-unused-vars
langflow-frontend-1  |   Line 10:10:   'TabsContext' is defined but never used                                                                                  @typescript-eslint/no-unused-vars
langflow-frontend-1  |   Line 17:27:   'ChatType' is defined but never used                                                                                     @typescript-eslint/no-unused-vars
langflow-frontend-1  |   Line 122:25:  Expected '===' and instead saw '=='                                                                                      eqeqeq
langflow-frontend-1  |   Line 167:6:   React Hook useEffect has missing dependencies: 'connectWS' and 'ws'. Either include them or remove the dependency array  react-hooks/exhaustive-deps
langflow-frontend-1  |   Line 175:6:   React Hook useEffect has a missing dependency: 'connectWS'. Either include it or remove the dependency array             react-hooks/exhaustive-deps
langflow-frontend-1  |   Line 200:6:   React Hook useEffect has a missing dependency: 'ws'. Either include it or remove the dependency array                    react-hooks/exhaustive-deps
langflow-frontend-1  | 
langflow-frontend-1  | src/modals/exportModal/index.tsx
langflow-frontend-1  |   Line 5:3:     'DocumentDuplicateIcon' is defined but never used  @typescript-eslint/no-unused-vars
langflow-frontend-1  |   Line 6:3:     'ComputerDesktopIcon' is defined but never used    @typescript-eslint/no-unused-vars
langflow-frontend-1  |   Line 18:11:   'setErrorData' is assigned a value but never used  @typescript-eslint/no-unused-vars
langflow-frontend-1  |   Line 101:50:  Expected '!==' and instead saw '!='                eqeqeq
langflow-frontend-1  | 
langflow-frontend-1  | src/modals/importModal/buttonBox/index.tsx
langflow-frontend-1  |   Line 2:10:  'DocumentDuplicateIcon' is defined but never used         @typescript-eslint/no-unused-vars
langflow-frontend-1  |   Line 68:4:  'descriptionFontSize' is assigned a value but never used  @typescript-eslint/no-unused-vars
langflow-frontend-1  | 
langflow-frontend-1  | src/modals/importModal/index.tsx
langflow-frontend-1  |   Line 4:3:    'ArrowDownTrayIcon' is defined but never used  @typescript-eslint/no-unused-vars
langflow-frontend-1  |   Line 15:10:  'error' is defined but never used              @typescript-eslint/no-unused-vars
langflow-frontend-1  | 
langflow-frontend-1  | src/modals/promptModal/index.tsx
langflow-frontend-1  |   Line 17:10:  'dark' is assigned a value but never used  @typescript-eslint/no-unused-vars
langflow-frontend-1  | 
langflow-frontend-1  | src/pages/FlowPage/components/extraSidebarComponent/index.tsx
langflow-frontend-1  |   Line 4:22:  'useEffect' is defined but never used  @typescript-eslint/no-unused-vars
langflow-frontend-1  |   Line 4:33:  'useState' is defined but never used   @typescript-eslint/no-unused-vars
langflow-frontend-1  | 
langflow-frontend-1  | src/pages/FlowPage/components/tabsManagerComponent/index.tsx
langflow-frontend-1  |   Line 1:33:   'useState' is defined but never used               @typescript-eslint/no-unused-vars
langflow-frontend-1  |   Line 22:49:  'uploadFlow' is assigned a value but never used    @typescript-eslint/no-unused-vars
langflow-frontend-1  |   Line 22:61:  'downloadFlow' is assigned a value but never used  @typescript-eslint/no-unused-vars
langflow-frontend-1  | 
langflow-frontend-1  | src/pages/FlowPage/index.tsx
langflow-frontend-1  |   Line 13:3:   'useKeyPress' is defined but never used                                                                                                  @typescript-eslint/no-unused-vars
langflow-frontend-1  |   Line 17:3:   'OnNodesDelete' is defined but never used                                                                                                @typescript-eslint/no-unused-vars
langflow-frontend-1  |   Line 46:11:  'undo' is assigned a value but never used                                                                                                @typescript-eslint/no-unused-vars
langflow-frontend-1  |   Line 46:17:  'redo' is assigned a value but never used                                                                                                @typescript-eslint/no-unused-vars
langflow-frontend-1  |   Line 46:23:  'canUndo' is assigned a value but never used                                                                                             @typescript-eslint/no-unused-vars
langflow-frontend-1  |   Line 46:32:  'canRedo' is assigned a value but never used                                                                                             @typescript-eslint/no-unused-vars
langflow-frontend-1  |   Line 264:5:  React Hook useCallback has a missing dependency: 'getId'. Either include it or remove the dependency array                               react-hooks/exhaustive-deps
langflow-frontend-1  |   Line 287:5:  React Hook useCallback has missing dependencies: 'reactFlowInstance' and 'setEdges'. Either include them or remove the dependency array  react-hooks/exhaustive-deps
langflow-frontend-1  |   Line 296:7:  React Hook useCallback has a missing dependency: 'setEdges'. Either include it or remove the dependency array                            react-hooks/exhaustive-deps
langflow-frontend-1  | 
langflow-frontend-1  | src/utils.ts
langflow-frontend-1  |   Line 21:27:  'TemplateVariableType' is defined but never used  @typescript-eslint/no-unused-vars
langflow-frontend-1  | 
langflow-frontend-1  | webpack compiled with 2 warnings
langflow-frontend-1  | No issues found.

developerisnow avatar May 11 '23 05:05 developerisnow

If you are using docker it accesses the backend container through http://backend:7860. You then have to restart the containers.

ogabrielluiz avatar May 11 '23 11:05 ogabrielluiz

If you are using docker it accesses the backend container through http://backend:7860. You then have to restart the containers.

Bro for sure I restarted more then 10 times, when backend is up, your frontend down, please read errors above

developerisnow avatar May 11 '23 20:05 developerisnow

clean the cookies and cache of your langflow, I got this one time and solved it like that

anovazzi1 avatar May 12 '23 00:05 anovazzi1