Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AI WebApp is not working #11566

Closed
5 tasks done
XiaoLey opened this issue Dec 11, 2024 · 6 comments
Closed
5 tasks done

AI WebApp is not working #11566

XiaoLey opened this issue Dec 11, 2024 · 6 comments
Labels
🐞 bug Something isn't working

Comments

@XiaoLey
Copy link
Contributor

XiaoLey commented Dec 11, 2024

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

main

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

image

docker log:

web-1  | 15:09:05 0|dify-web  | TypeError: Promise.withResolvers is not a function
web-1  | 15:09:05 0|dify-web  |     at 23549 (/app/web/.next/server/chunks/19063.js:86:60114)
web-1  | 15:09:05 0|dify-web  |     at t (/app/web/.next/server/webpack-runtime.js:1:143)
web-1  | 15:09:05 0|dify-web  |     at 89449 (/app/web/.next/server/chunks/25039.js:1:72160)
web-1  | 15:09:05 0|dify-web  |     at t (/app/web/.next/server/webpack-runtime.js:1:143)
web-1  | 15:09:05 0|dify-web  |     at 50007 (/app/web/.next/server/chunks/50007.js:5:5436)
web-1  | 15:09:05 0|dify-web  |     at t (/app/web/.next/server/webpack-runtime.js:1:143)
web-1  | 15:09:05 0|dify-web  |     at 69223 (/app/web/.next/server/app/(shareLayout)/chat/[token]/page.js:1:2282)
web-1  | 15:09:05 0|dify-web  |     at Object.t [as require] (/app/web/.next/server/webpack-runtime.js:1:143)
web-1  | 15:09:05 0|dify-web  |     at require (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:16:18678)
web-1  | 15:09:05 0|dify-web  |     at i (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:88294) {
web-1  | 15:09:05 0|dify-web  |   digest: '3640524666'
web-1  | 15:09:05 0|dify-web  | }

✔️ Expected Behavior

No response

❌ Actual Behavior

No response

@dosubot dosubot bot added the 🐞 bug Something isn't working label Dec 11, 2024
Copy link

dosubot bot commented Dec 11, 2024

I found a similar unsolved discussion titled Help Problem starting the project which might be related to the issue you're experiencing [1].

Regarding the error message you're encountering, the TypeError: Promise.withResolvers is not a function suggests that there might be an issue with the usage of Promise.withResolvers in the code. This function might not be available or correctly imported in your environment.

To troubleshoot this issue, consider the following steps:

  1. Check for Updates: Ensure that all dependencies are up-to-date. There might be a missing or outdated package that provides the Promise.withResolvers function.

  2. Review Code: Look into the specific files mentioned in the error log (19063.js, 25039.js, 50007.js, and page.js) to identify where Promise.withResolvers is being used. Verify if it's correctly implemented or if an alternative approach is needed.

  3. Environment Configuration: Double-check your Docker setup and environment variables to ensure everything is configured correctly. Misconfigurations can sometimes lead to unexpected errors.

  4. Consult Documentation: If Promise.withResolvers is a custom utility function, refer to the project's documentation or codebase to understand its intended use and implementation.

If these steps do not resolve the issue, further investigation into the specific implementation of Promise.withResolvers in your codebase might be necessary.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@XiaoLey
Copy link
Contributor Author

XiaoLey commented Dec 12, 2024

Just to clarify, I didn't make any changes to the .env file (for example, APP_WEB_URL remained the same as before). I only added some new variables. Everything was working fine prior to this, but after upgrading to the main version yesterday, the webapp started acting abnormally.

I tried using chat and workflow, tested multiple Dify projects, and even attempted updating the webapp's URL, but none of these efforts worked.

@mayiming0708
Copy link

@XiaoLey It seems that the react-pdf-highlighter component references pdfjs, and this component is not compatible with Node 20. You might consider using Node 22 to rebuild the image or downgrading the component.

@fsea
Copy link

fsea commented Dec 13, 2024

澄清一下,我没有对文件进行任何更改(例如,与以前相同)。我只添加了一些新变量。在此之前一切正常,但是昨天升级到主版本后,网络应用程序开始运行异常。.env``APP_WEB_URL

我尝试使用聊天和工作流程,测试了多个 Dify 项目,甚至尝试更新 Web 应用程序的 URL,但这些努力都没有奏效。

Also experiencing this issue, WebApp is not working

@mayiming0708
Copy link

@fsea just upgrade node version to 22

@fsea
Copy link

fsea commented Dec 13, 2024

warning "@lexical/react > @lexical/yjs@0.16.1" has unmet peer dependency "yjs@>=13.5.22".
warning " > @mdx-js/loader@2.3.0" has unmet peer dependency "webpack@>=4".
warning " > @monaco-editor/react@4.6.0" has unmet peer dependency "monaco-editor@>= 0.25.0 < 1".
warning "@monaco-editor/react > @monaco-editor/loader@1.4.0" has unmet peer dependency "monaco-editor@>= 0.21.0 < 1".
warning "@storybook/nextjs > @pmmmwh/react-refresh-webpack-plugin@0.5.15" has unmet peer dependency "webpack@>=4.43.0 <6.0.0".
warning "@storybook/nextjs > babel-loader@9.2.1" has unmet peer dependency "webpack@>=5".
warning "@storybook/nextjs > node-polyfill-webpack-plugin@2.0.1" has unmet peer dependency "webpack@>=5".
warning "@storybook/nextjs > sass-loader@13.3.3" has unmet peer dependency "webpack@^5.0.0".
warning "@storybook/nextjs > style-loader@3.3.4" has unmet peer dependency "webpack@^5.0.0".
[5/5] Building fresh packages...
warning Error running install script for optional dependency: "/app/web/node_modules/canvas: Command failed.
Exit code: 1
Command: node-pre-gyp install --fallback-to-build --update-binary
Arguments:
Directory: /app/web/node_modules/canvas
Output:
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using node-pre-gyp@1.0.11
node-pre-gyp info using node@22.12.0 | linux | x64
(node:35) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead.
(Use node --trace-deprecation ... to show where the warning was created)
node-pre-gyp http GET https://github.com/Automattic/node-canvas/releases/download/v2.11.2/canvas-v2.11.2-node-v127-linux-musl-x64.tar.gz
node-pre-gyp ERR! install response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.11.2/canvas-v2.11.2-node-v127-linux-musl-x64.tar.gz
node-pre-gyp WARN Pre-built binaries not installable for canvas@2.11.2 and node@22.12.0 (node-v127 ABI, musl) (falling back to source compile with node-gyp)
node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.11.2/canvas-v2.11.2-node-v127-linux-musl-x64.tar.gz
gyp info it worked if it ends with ok
gyp info using node-gyp@10.2.0
gyp info using node@22.12.0 | linux | x64
gyp info ok
gyp info it worked if it ends with ok
gyp info using node-gyp@10.2.0
gyp info using node@22.12.0 | linux | x64
gyp ERR! find Python
gyp ERR! find Python Python is not set from command line or npm configuration
gyp ERR! find Python Python is not set from environment variable PYTHON
gyp ERR! find Python checking if "python3" can be used
gyp ERR! find Python - executable path is ""
gyp ERR! find Python - "" could not be run
gyp ERR! find Python checking if "python" can be used
gyp ERR! find Python - executable path is ""
gyp ERR! find Python - "" could not be run
gyp ERR! find Python
gyp ERR! find Python **********************************************************
gyp ERR! find Python You need to install the latest version of Python.
gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
gyp ERR! find Python you can try one of the following options:
gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable"
gyp ERR! find Python (accepted by both node-gyp and npm)
gyp ERR! find Python - Set the environment variable PYTHON
gyp ERR! find Python - Set the npm configuration variable python:
gyp ERR! find Python npm config set python "/path/to/pythonexecutable"
gyp ERR! find Python For more information consult the documentation at:
gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
gyp ERR! find Python **********************************************************
gyp ERR! find Python
gyp ERR! configure error
gyp ERR! stack Error: Could not find any Python installation to use
gyp ERR! stack at PythonFinder.fail (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:306:11)
gyp ERR! stack at PythonFinder.findPython (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:164:17)
gyp ERR! stack at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
gyp ERR! stack at async configure (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:27:18)
gyp ERR! stack at async run (/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js:81:18)
gyp ERR! System Linux 6.8.0-50-generic
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--update-binary" "--module=/app/web/node_modules/canvas/build/Release/canvas.node" "--module_name=canvas" "--module_path=/app/web/node_modules/canvas/build/Release" "--napi_version=9" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v127"
gyp ERR! cwd /app/web/node_modules/canvas
gyp ERR! node -v v22.12.0
gyp ERR! node-gyp -v v10.2.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --update-binary --module=/app/web/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/app/web/node_modules/canvas/build/Release --napi_version=9 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v127' (1)
node-pre-gyp ERR! stack at ChildProcess. (/app/web/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js:89:23)
node-pre-gyp ERR! stack at ChildProcess.emit (node:events:524:28)
node-pre-gyp ERR! stack at maybeClose (node:internal/child_process:1101:16)
node-pre-gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:304:5)
node-pre-gyp ERR! System Linux 6.8.0-50-generic
node-pre-gyp ERR! command "/usr/local/bin/node" "/app/web/node_modules/canvas/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--update-binary"
node-pre-gyp ERR! cwd /app/web/node_modules/canvas
node-pre-gyp ERR! node -v v22.12.0
node-pre-gyp ERR! node-pre-gyp -v v1.0.11
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --update-binary --module=/app/web/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/app/web/node_modules/canvas/build/Release --napi_version=9 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v127' (1)"
info This module is OPTIONAL, you can safely ignore this error

@XiaoLey XiaoLey closed this as completed Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants