FlowiseAI / Flowise

Drag & drop UI to build your customized LLM flow
https://flowiseai.com
Apache License 2.0
31.45k stars 16.37k forks source link

[BUG] Dependency Declaration Flowise Build Process #1913

Closed seb-tc closed 8 months ago

seb-tc commented 8 months ago

Describe the Bug

During the build process of the Flowise project, two main issues are encountered. First, the babel-preset-react-app package is importing the @babel/plugin-proposal-private-property-in-object package without declaring it in its dependencies. Second, the langchain/dist/util/bedrock module cannot be found, causing errors in AWSChatBedrock.ts and AWSBedrock.ts.

To Reproduce

Steps to reproduce the behavior:

  1. Clone the Flowise Main branch from the repository.
  2. Run yarn install to install dependencies.
  3. Run yarn build to build the project.
  4. See the error messages related to babel-preset-react-app and langchain/dist/util/bedrock.

Expected Behavior

The build process should complete without any errors, and all dependencies should be correctly declared and found.

Setup

Additional Context

The error messages suggest two potential solutions. For the babel-preset-react-app issue, adding @babel/plugin-proposal-private-property-in-object to the project's devDependencies might resolve the problem. For the langchain/dist/util/bedrock issue, ensuring that the langchain package is correctly installed and that the path to the bedrock module is correct might solve the issue.


yarn run v1.22.19
$ turbo run build
• Packages in scope: flowise, flowise-components, flowise-ui
• Running build in 3 packages
• Remote caching disabled
flowise-components:build: cache miss, executing aedfef25341be3f5
flowise-components:build: 
flowise-ui:build: cache miss, executing add33f00bd413b4a
flowise-ui:build: 
$ craco build
$ tsc && gulp
flowise-ui:build: Creating an optimized production build...
flowise-ui:build: One of your dependencies, babel-preset-react-app, is importing the
flowise-ui:build: "@babel/plugin-proposal-private-property-in-object" package without
flowise-ui:build: declaring it in its dependencies. This is currently working because
flowise-ui:build: "@babel/plugin-proposal-private-property-in-object" is already in your
flowise-ui:build: node_modules folder for unrelated reasons, but it may break at any time.
flowise-ui:build: 
flowise-ui:build: babel-preset-react-app is part of the create-react-app project, which
flowise-ui:build: is not maintianed anymore. It is thus unlikely that this bug will
flowise-ui:build: ever be fixed. Add "@babel/plugin-proposal-private-property-in-object" to
flowise-ui:build: your devDependencies to work around this error. This will make this message
flowise-ui:build: go away.
flowise-ui:build:   
flowise-components:build: nodes/chatmodels/AWSBedrock/AWSChatBedrock.ts:4:34 - error TS2307: Cannot find module 'langchain/dist/util/bedrock' or its corresponding type declarations.
flowise-components:build: 
flowise-components:build: 4 import { BaseBedrockInput } from 'langchain/dist/util/bedrock'
flowise-components:build:                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flowise-components:build: 
flowise-components:build: nodes/llms/AWSBedrock/AWSBedrock.ts:4:34 - error TS2307: Cannot find module 'langchain/dist/util/bedrock' or its corresponding type declarations.
flowise-components:build: 
flowise-components:build: 4 import { BaseBedrockInput } from 'langchain/dist/util/bedrock'
flowise-components:build:                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flowise-components:build: 
flowise-components:build: 
flowise-components:build: Found 2 errors in 2 files.
flowise-components:build: 
flowise-components:build: Errors  Files
flowise-components:build:      1  nodes/chatmodels/AWSBedrock/AWSChatBedrock.ts:4
flowise-components:build:      1  nodes/llms/AWSBedrock/AWSBedrock.ts:4
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
flowise-components:build: ERROR: command finished with error: command (/Users/seb/Projects/Flowise_market/Flowise/packages/components) /tmp/yarn--1710066819339-0.6961517754182709/yarn run build exited (2)
flowise-components#build: command (/Users/seb/Projects/Flowise_market/Flowise/packages/components) /tmp/yarn--1710066819339-0.6961517754182709/yarn run build exited (2)

 Tasks:    0 successful, 2 total
Cached:    0 cached, 2 total
  Time:    7.993s 
Failed:    flowise-components#build

 ERROR  run failed: command  exited (2)
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
yarn run v1.22.19
$ run-script-os
$ cd packages/server/bin && ./run start
 ›   Error: command start not found
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
seb-tc commented 8 months ago

Renaming these two node files with .OLD (in green) temporarily removing them from the build path will let the server build and initiate again.

nodes/chatmodels/AWSBedrock/AWSChatBedrock.ts:4 nodes/llms/AWSBedrock/AWSBedrock.ts:4

Screenshot 2024-03-10 at 12 19 18
vinodkiran commented 8 months ago

raised a PR to fix the build failure :: https://github.com/FlowiseAI/Flowise/pull/1914

seb-tc commented 8 months ago

Just tested, that fixed the issue thanks guys!