从腾讯企业微信连接报错500 #975

Closed
opened 2026-02-21 17:29:18 -05:00 by yindo · 4 comments
Owner

Originally created by @triumph on GitHub (Jan 25, 2024).

Self Checks

Dify version

0.50.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

从iphone手机版腾讯企业微信连接报错500, 从iphone浏览器连接虽然也有500报错,但是可以进入应用页面。web_1 | 2024-01-26T00:55:47.430040713Z ReferenceError: window is not defined
web_1 | 2024-01-26T00:55:47.430060621Z at 3687 (/app/web/.next/server/chunks/6097.js:1:27551)
web_1 | 2024-01-26T00:55:47.430063446Z at t (/app/web/.next/server/webpack-runtime.js:1:143)
web_1 | 2024-01-26T00:55:47.430065338Z at 67160 (/app/web/.next/server/chunks/7160.js:1:10468)
web_1 | 2024-01-26T00:55:47.430067113Z at t (/app/web/.next/server/webpack-runtime.js:1:143)
web_1 | 2024-01-26T00:55:47.430068852Z at F (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:91937)
web_1 | 2024-01-26T00:55:47.430070660Z at $ (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:90488)
web_1 | 2024-01-26T00:55:47.430080255Z at rC (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:33840)
web_1 | 2024-01-26T00:55:47.430082508Z at n$ (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:59861)
web_1 | 2024-01-26T00:55:47.430084390Z at nj (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:64628)
web_1 | 2024-01-26T00:55:47.430086259Z at nO (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:64035)
nginx_1 | 2024-01-26T00:55:47.440466076Z 192.168.21.180 - - [26/Jan/2024:00:55:47 +0000] "GET /chat/FgZwKy3VHdLriEx5 HTTP/1.1" 500 4877 "https://aiworkbench.stone.test.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Language/zh ColorScheme/Light DistType/publish-website wxwork/4.1.15 (MicroMessenger/6.2) WeChat/2.0.4 Safari/605.1.15" "124.74.138.218, 172.16.82.7, 124.74.138.218"
web_1 | 2024-01-26T00:55:49.469844438Z ReferenceError: window is not defined
web_1 | 2024-01-26T00:55:49.469863020Z at 3687 (/app/web/.next/server/chunks/6097.js:1:27551)
web_1 | 2024-01-26T00:55:49.469864460Z at t (/app/web/.next/server/webpack-runtime.js:1:143)
web_1 | 2024-01-26T00:55:49.469865423Z at 67160 (/app/web/.next/server/chunks/7160.js:1:10468)
web_1 | 2024-01-26T00:55:49.469866380Z at t (/app/web/.next/server/webpack-runtime.js:1:143)
web_1 | 2024-01-26T00:55:49.469867659Z at F (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:91937)
web_1 | 2024-01-26T00:55:49.469868782Z at $ (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:90488)
web_1 | 2024-01-26T00:55:49.469869810Z at rC (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:33840)
web_1 | 2024-01-26T00:55:49.469870831Z at n$ (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:59861)
web_1 | 2024-01-26T00:55:49.469871816Z at nj (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:64628)
web_1 | 2024-01-26T00:55:49.469872820Z at nO (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:64035)
nginx_1 | 2024-01-26T00:55:49.480631356Z 192.168.21.180 - - [26/Jan/2024:00:55:49 +0000] "GET /chat/FgZwKy3VHdLriEx5 HTTP/1.1" 500 4872 "https://aiworkbench.stone.test.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Language/zh ColorScheme/Light DistType/publish-website wxwork/4.1.15 (MicroMessenger/6.2) WeChat/2.0.4 Safari/605.1.15" "124.74.138.218, 172.16.82.7, 124.74.138.218"
web_1 | 2024-01-26T00:55:51.246393738Z ReferenceError: window is not defined
web_1 | 2024-01-26T00:55:51.246408436Z at 3687 (/app/web/.next/server/chunks/6097.js:1:27551)
web_1 | 2024-01-26T00:55:51.246409892Z at t (/app/web/.next/server/webpack-runtime.js:1:143)
web_1 | 2024-01-26T00:55:51.246410883Z at 67160 (/app/web/.next/server/chunks/7160.js:1:10468)
web_1 | 2024-01-26T00:55:51.246411860Z at t (/app/web/.next/server/webpack-runtime.js:1:143)
web_1 | 2024-01-26T00:55:51.246412853Z at F (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:91937)
web_1 | 2024-01-26T00:55:51.246413850Z at $ (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:90488)
web_1 | 2024-01-26T00:55:51.246414827Z at rC (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:33840)
web_1 | 2024-01-26T00:55:51.246416011Z at n$ (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:59861)
web_1 | 2024-01-26T00:55:51.246417078Z at nj (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:64628)
web_1 | 2024-01-26T00:55:51.246418060Z at nO (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:64035)
nginx_1 | 2024-01-26T00:55:51.255989712Z 192.168.21.180 - - [26/Jan/2024:00:55:51 +0000] "GET /chat/FgZwKy3VHdLriEx5 HTTP/1.1" 500 4877 "https://aiworkbench.stone.test.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Language/zh ColorScheme/Light DistType/publish-website wxwork/4.1.15 (MicroMessenger/6.2) WeChat/2.0.4 Safari/605.1.15" "124.74.138.218, 172.16.82.7, 124.74.138.218"

以上是从 苹果mac的企业微信从链接过来的日志。

web_1 | 2024-01-26T00:56:06.726451954Z ReferenceError: window is not defined
web_1 | 2024-01-26T00:56:06.726475655Z at 3687 (/app/web/.next/server/chunks/6097.js:1:27551)
web_1 | 2024-01-26T00:56:06.726478751Z at t (/app/web/.next/server/webpack-runtime.js:1:143)
web_1 | 2024-01-26T00:56:06.726480758Z at 67160 (/app/web/.next/server/chunks/7160.js:1:10468)
web_1 | 2024-01-26T00:56:06.726482506Z at t (/app/web/.next/server/webpack-runtime.js:1:143)
web_1 | 2024-01-26T00:56:06.726484721Z at F (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:91937)
web_1 | 2024-01-26T00:56:06.726486912Z at $ (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:90488)
web_1 | 2024-01-26T00:56:06.726488667Z at rC (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:33840)
web_1 | 2024-01-26T00:56:06.726490361Z at n$ (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:59861)
web_1 | 2024-01-26T00:56:06.726492105Z at nj (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:64628)
web_1 | 2024-01-26T00:56:06.726493904Z at nO (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:64035)
nginx_1 | 2024-01-26T00:56:06.734402994Z 192.168.21.180 - - [26/Jan/2024:00:56:06 +0000] "GET /chat/FgZwKy3VHdLriEx5 HTTP/1.1" 500 4877 "https://aiworkbench.stone.test.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Safari/605.1.15" "124.74.138.218, 172.16.82.7, 124.74.138.218"
nginx_1 | 2024-01-26T00:56:06.775184085Z 192.168.21.180 - - [26/Jan/2024:00:56:06 +0000] "GET /logo/logo-site.png HTTP/1.1" 304 0 "https://dify.stone.test.com/chat/FgZwKy3VHdLriEx5" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Safari/605.1.15" "124.74.138.218, 172.16.82.7, 124.74.138.218"
nginx_1 | 2024-01-26T00:56:06.923055029Z 192.168.21.180 - - [26/Jan/2024:00:56:06 +0000] "GET /api/parameters HTTP/1.1" 200 845 "https://dify.stone.test.com/chat/FgZwKy3VHdLriEx5" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Safari/605.1.15" "124.74.138.218, 172.16.82.7, 124.74.138.218"
nginx_1 | 2024-01-26T00:56:06.937944451Z 192.168.21.180 - - [26/Jan/2024:00:56:06 +0000] "GET /api/site HTTP/1.1" 200 885 "https://dify.stone.test.com/chat/FgZwKy3VHdLriEx5" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Safari/605.1.15" "124.74.138.218, 172.16.82.7, 124.74.138.218"
nginx_1 | 2024-01-26T00:56:06.945436878Z 192.168.21.180 - - [26/Jan/2024:00:56:06 +0000] "GET /api/meta HTTP/1.1" 200 19 "https://dify.stone.test.com/chat/FgZwKy3VHdLriEx5" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Safari/605.1.15" "124.74.138.218, 172.16.82.7, 124.74.138.218"
nginx_1 | 2024-01-26T00:56:06.951431750Z 192.168.21.180 - - [26/Jan/2024:00:56:06 +0000] "GET /api/conversations?limit=100 HTTP/1.1" 200 46 "https://dify.stone.test.com/chat/FgZwKy3VHdLriEx5" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Safari/605.1.15" "124.74.138.218, 172.16.82.7, 124.74.138.218"
nginx_1 | 2024-01-26T00:56:06.990989998Z 192.168.21.180 - - [26/Jan/2024:00:56:06 +0000] "GET /logo/logo-site.png HTTP/1.1" 304 0 "https://dify.stone.test.com/chat/FgZwKy3VHdLriEx5" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Safari/605.1.15" "124.74.138.218, 172.16.82.7, 124.74.138.218"
nginx_1 | 2024-01-26T00:56:07.005692748Z 192.168.21.180 - - [26/Jan/2024:00:56:07 +0000] "GET /api/conversations?limit=20&pinned=true HTTP/1.1" 200 45 "https://dify.stone.test.com/chat/FgZwKy3VHdLriEx5" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Safari/605.1.15" "124.74.138.218, 172.16.82.7, 124.74.138.218"
nginx_1 | 2024-01-26T00:56:07.009295473Z 192.168.21.180 - - [26/Jan/2024:00:56:07 +0000] "GET /api/conversations?limit=20&pinned=false HTTP/1.1" 200 45 "https://dify.stone.test.com/chat/FgZwKy3VHdLriEx5" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Safari/605.1.15" "124.74.138.218, 172.16.82.7, 124.74.138.218"
nginx_1 | 2024-01-26T00:56:07.046512472Z 192.168.21.180 - - [26/Jan/2024:00:56:07 +0000] "GET /api/conversations?limit=20&pinned=false HTTP/1.1" 200 45 "https://dify.stone.test.com/chat/FgZwKy3VHdLriEx5" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Safari/605.1.15" "124.74.138.218, 172.16.82.7, 124.74.138.218"

以上是苹果mac上的默认浏览器链接。虽然也有500错误,但是最终还是可以进入到应用。

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @triumph on GitHub (Jan 25, 2024). ### Self Checks - [X] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [X] I confirm that I am using English to file this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). ### Dify version 0.50.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce 从iphone手机版腾讯企业微信连接报错500, 从iphone浏览器连接虽然也有500报错,但是可以进入应用页面。web_1 | 2024-01-26T00:55:47.430040713Z ReferenceError: window is not defined web_1 | 2024-01-26T00:55:47.430060621Z at 3687 (/app/web/.next/server/chunks/6097.js:1:27551) web_1 | 2024-01-26T00:55:47.430063446Z at t (/app/web/.next/server/webpack-runtime.js:1:143) web_1 | 2024-01-26T00:55:47.430065338Z at 67160 (/app/web/.next/server/chunks/7160.js:1:10468) web_1 | 2024-01-26T00:55:47.430067113Z at t (/app/web/.next/server/webpack-runtime.js:1:143) web_1 | 2024-01-26T00:55:47.430068852Z at F (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:91937) web_1 | 2024-01-26T00:55:47.430070660Z at $ (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:90488) web_1 | 2024-01-26T00:55:47.430080255Z at rC (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:33840) web_1 | 2024-01-26T00:55:47.430082508Z at n$ (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:59861) web_1 | 2024-01-26T00:55:47.430084390Z at nj (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:64628) web_1 | 2024-01-26T00:55:47.430086259Z at nO (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:64035) nginx_1 | 2024-01-26T00:55:47.440466076Z 192.168.21.180 - - [26/Jan/2024:00:55:47 +0000] "GET /chat/FgZwKy3VHdLriEx5 HTTP/1.1" 500 4877 "https://aiworkbench.stone.test.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Language/zh ColorScheme/Light DistType/publish-website wxwork/4.1.15 (MicroMessenger/6.2) WeChat/2.0.4 Safari/605.1.15" "124.74.138.218, 172.16.82.7, 124.74.138.218" web_1 | 2024-01-26T00:55:49.469844438Z ReferenceError: window is not defined web_1 | 2024-01-26T00:55:49.469863020Z at 3687 (/app/web/.next/server/chunks/6097.js:1:27551) web_1 | 2024-01-26T00:55:49.469864460Z at t (/app/web/.next/server/webpack-runtime.js:1:143) web_1 | 2024-01-26T00:55:49.469865423Z at 67160 (/app/web/.next/server/chunks/7160.js:1:10468) web_1 | 2024-01-26T00:55:49.469866380Z at t (/app/web/.next/server/webpack-runtime.js:1:143) web_1 | 2024-01-26T00:55:49.469867659Z at F (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:91937) web_1 | 2024-01-26T00:55:49.469868782Z at $ (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:90488) web_1 | 2024-01-26T00:55:49.469869810Z at rC (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:33840) web_1 | 2024-01-26T00:55:49.469870831Z at n$ (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:59861) web_1 | 2024-01-26T00:55:49.469871816Z at nj (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:64628) web_1 | 2024-01-26T00:55:49.469872820Z at nO (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:64035) nginx_1 | 2024-01-26T00:55:49.480631356Z 192.168.21.180 - - [26/Jan/2024:00:55:49 +0000] "GET /chat/FgZwKy3VHdLriEx5 HTTP/1.1" 500 4872 "https://aiworkbench.stone.test.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Language/zh ColorScheme/Light DistType/publish-website wxwork/4.1.15 (MicroMessenger/6.2) WeChat/2.0.4 Safari/605.1.15" "124.74.138.218, 172.16.82.7, 124.74.138.218" web_1 | 2024-01-26T00:55:51.246393738Z ReferenceError: window is not defined web_1 | 2024-01-26T00:55:51.246408436Z at 3687 (/app/web/.next/server/chunks/6097.js:1:27551) web_1 | 2024-01-26T00:55:51.246409892Z at t (/app/web/.next/server/webpack-runtime.js:1:143) web_1 | 2024-01-26T00:55:51.246410883Z at 67160 (/app/web/.next/server/chunks/7160.js:1:10468) web_1 | 2024-01-26T00:55:51.246411860Z at t (/app/web/.next/server/webpack-runtime.js:1:143) web_1 | 2024-01-26T00:55:51.246412853Z at F (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:91937) web_1 | 2024-01-26T00:55:51.246413850Z at $ (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:90488) web_1 | 2024-01-26T00:55:51.246414827Z at rC (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:33840) web_1 | 2024-01-26T00:55:51.246416011Z at n$ (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:59861) web_1 | 2024-01-26T00:55:51.246417078Z at nj (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:64628) web_1 | 2024-01-26T00:55:51.246418060Z at nO (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:64035) nginx_1 | 2024-01-26T00:55:51.255989712Z 192.168.21.180 - - [26/Jan/2024:00:55:51 +0000] "GET /chat/FgZwKy3VHdLriEx5 HTTP/1.1" 500 4877 "https://aiworkbench.stone.test.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Language/zh ColorScheme/Light DistType/publish-website wxwork/4.1.15 (MicroMessenger/6.2) WeChat/2.0.4 Safari/605.1.15" "124.74.138.218, 172.16.82.7, 124.74.138.218" 以上是从 苹果mac的企业微信从链接过来的日志。 web_1 | 2024-01-26T00:56:06.726451954Z ReferenceError: window is not defined web_1 | 2024-01-26T00:56:06.726475655Z at 3687 (/app/web/.next/server/chunks/6097.js:1:27551) web_1 | 2024-01-26T00:56:06.726478751Z at t (/app/web/.next/server/webpack-runtime.js:1:143) web_1 | 2024-01-26T00:56:06.726480758Z at 67160 (/app/web/.next/server/chunks/7160.js:1:10468) web_1 | 2024-01-26T00:56:06.726482506Z at t (/app/web/.next/server/webpack-runtime.js:1:143) web_1 | 2024-01-26T00:56:06.726484721Z at F (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:91937) web_1 | 2024-01-26T00:56:06.726486912Z at $ (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:90488) web_1 | 2024-01-26T00:56:06.726488667Z at rC (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:33840) web_1 | 2024-01-26T00:56:06.726490361Z at n$ (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:59861) web_1 | 2024-01-26T00:56:06.726492105Z at nj (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:64628) web_1 | 2024-01-26T00:56:06.726493904Z at nO (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:64035) nginx_1 | 2024-01-26T00:56:06.734402994Z 192.168.21.180 - - [26/Jan/2024:00:56:06 +0000] "GET /chat/FgZwKy3VHdLriEx5 HTTP/1.1" 500 4877 "https://aiworkbench.stone.test.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Safari/605.1.15" "124.74.138.218, 172.16.82.7, 124.74.138.218" nginx_1 | 2024-01-26T00:56:06.775184085Z 192.168.21.180 - - [26/Jan/2024:00:56:06 +0000] "GET /logo/logo-site.png HTTP/1.1" 304 0 "https://dify.stone.test.com/chat/FgZwKy3VHdLriEx5" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Safari/605.1.15" "124.74.138.218, 172.16.82.7, 124.74.138.218" nginx_1 | 2024-01-26T00:56:06.923055029Z 192.168.21.180 - - [26/Jan/2024:00:56:06 +0000] "GET /api/parameters HTTP/1.1" 200 845 "https://dify.stone.test.com/chat/FgZwKy3VHdLriEx5" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Safari/605.1.15" "124.74.138.218, 172.16.82.7, 124.74.138.218" nginx_1 | 2024-01-26T00:56:06.937944451Z 192.168.21.180 - - [26/Jan/2024:00:56:06 +0000] "GET /api/site HTTP/1.1" 200 885 "https://dify.stone.test.com/chat/FgZwKy3VHdLriEx5" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Safari/605.1.15" "124.74.138.218, 172.16.82.7, 124.74.138.218" nginx_1 | 2024-01-26T00:56:06.945436878Z 192.168.21.180 - - [26/Jan/2024:00:56:06 +0000] "GET /api/meta HTTP/1.1" 200 19 "https://dify.stone.test.com/chat/FgZwKy3VHdLriEx5" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Safari/605.1.15" "124.74.138.218, 172.16.82.7, 124.74.138.218" nginx_1 | 2024-01-26T00:56:06.951431750Z 192.168.21.180 - - [26/Jan/2024:00:56:06 +0000] "GET /api/conversations?limit=100 HTTP/1.1" 200 46 "https://dify.stone.test.com/chat/FgZwKy3VHdLriEx5" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Safari/605.1.15" "124.74.138.218, 172.16.82.7, 124.74.138.218" nginx_1 | 2024-01-26T00:56:06.990989998Z 192.168.21.180 - - [26/Jan/2024:00:56:06 +0000] "GET /logo/logo-site.png HTTP/1.1" 304 0 "https://dify.stone.test.com/chat/FgZwKy3VHdLriEx5" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Safari/605.1.15" "124.74.138.218, 172.16.82.7, 124.74.138.218" nginx_1 | 2024-01-26T00:56:07.005692748Z 192.168.21.180 - - [26/Jan/2024:00:56:07 +0000] "GET /api/conversations?limit=20&pinned=true HTTP/1.1" 200 45 "https://dify.stone.test.com/chat/FgZwKy3VHdLriEx5" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Safari/605.1.15" "124.74.138.218, 172.16.82.7, 124.74.138.218" nginx_1 | 2024-01-26T00:56:07.009295473Z 192.168.21.180 - - [26/Jan/2024:00:56:07 +0000] "GET /api/conversations?limit=20&pinned=false HTTP/1.1" 200 45 "https://dify.stone.test.com/chat/FgZwKy3VHdLriEx5" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Safari/605.1.15" "124.74.138.218, 172.16.82.7, 124.74.138.218" nginx_1 | 2024-01-26T00:56:07.046512472Z 192.168.21.180 - - [26/Jan/2024:00:56:07 +0000] "GET /api/conversations?limit=20&pinned=false HTTP/1.1" 200 45 "https://dify.stone.test.com/chat/FgZwKy3VHdLriEx5" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Safari/605.1.15" "124.74.138.218, 172.16.82.7, 124.74.138.218" 以上是苹果mac上的默认浏览器链接。虽然也有500错误,但是最终还是可以进入到应用。 ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug label 2026-02-21 17:29:18 -05:00
yindo closed this issue 2026-02-21 17:29:18 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jan 25, 2024):

🤖

Hey @triumph! Good to see you again. Looks like we've got another puzzle on our hands, huh? 🕵️‍♂️

The error "ReferenceError: window is not defined" typically occurs when you are trying to access the window object in a JavaScript environment where it doesn't exist. In this case, it seems like the window object is being accessed in a server-side environment (Node.js) where it doesn't exist. The window object is a browser-specific global object and is not available in a server-side environment.

In the provided context, the window object is being accessed in the embedChatbot function:

const difyChatbotConfig = window.difyChatbotConfig;

This line of code is trying to access the difyChatbotConfig property of the window object. If this script is being executed in a server-side environment, it will throw the "ReferenceError: window is not defined" error because the window object doesn't exist in that environment.

To fix this issue, you need to ensure that this script is only executed in a browser environment where the window object exists. You can do this by adding a check at the beginning of your script to see if the window object exists before trying to access its properties:

if (typeof window !== 'undefined') {
  const difyChatbotConfig = window.difyChatbotConfig;
  // rest of your code...
}

This will prevent the "ReferenceError: window is not defined" error from being thrown when the script is executed in a server-side environment. However, it will also mean that the embedChatbot function will not be executed in a server-side environment, so you will need to ensure that this function is only needed in a browser environment.

The window.difyChatbotConfig object in the Dify codebase is used to configure the chatbot that is embedded in a website. It should be defined in the HTML file before the script is included. The difyChatbotConfig object should contain the token of the chatbot, which can be found in the chatbot settings page.

The difyChatbotConfig object is used in the embedChatbot function to set up the chatbot. If the difyChatbotConfig object or the token is not provided, an error message is logged to the console. The difyChatbotConfig object can also contain other optional properties such as isDev and baseUrl which are used to configure the chatbot's environment and base URL respectively.

Here is the relevant code snippet:

const difyChatbotConfig = window.difyChatbotConfig;
if (!difyChatbotConfig || !difyChatbotConfig.token) {
  console.error('difyChatbotConfig is empty or token is not provided')
  return;
}
const isDev = !!difyChatbotConfig.isDev
const baseUrl = difyChatbotConfig.baseUrl || `https://${isDev ? 'dev.' : ''}udify.app`

You can find more details in the embed.js file in the Dify codebase.

Sources


This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

@dosubot[bot] commented on GitHub (Jan 25, 2024): _🤖_ <!-- Greeting --> Hey @triumph! Good to see you again. Looks like we've got another puzzle on our hands, huh? 🕵️‍♂️ <!-- Answer --> The error "ReferenceError: window is not defined" typically occurs when you are trying to access the `window` object in a JavaScript environment where it doesn't exist. In this case, it seems like the `window` object is being accessed in a server-side environment (Node.js) where it doesn't exist. The `window` object is a browser-specific global object and is not available in a server-side environment. In the provided context, the `window` object is being accessed in the `embedChatbot` function: ```js const difyChatbotConfig = window.difyChatbotConfig; ``` This line of code is trying to access the `difyChatbotConfig` property of the `window` object. If this script is being executed in a server-side environment, it will throw the "ReferenceError: window is not defined" error because the `window` object doesn't exist in that environment. To fix this issue, you need to ensure that this script is only executed in a browser environment where the `window` object exists. You can do this by adding a check at the beginning of your script to see if the `window` object exists before trying to access its properties: ```js if (typeof window !== 'undefined') { const difyChatbotConfig = window.difyChatbotConfig; // rest of your code... } ``` This will prevent the "ReferenceError: window is not defined" error from being thrown when the script is executed in a server-side environment. However, it will also mean that the `embedChatbot` function will not be executed in a server-side environment, so you will need to ensure that this function is only needed in a browser environment. The `window.difyChatbotConfig` object in the Dify codebase is used to configure the chatbot that is embedded in a website. It should be defined in the HTML file before the script is included. The `difyChatbotConfig` object should contain the token of the chatbot, which can be found in the chatbot settings page. The `difyChatbotConfig` object is used in the `embedChatbot` function to set up the chatbot. If the `difyChatbotConfig` object or the token is not provided, an error message is logged to the console. The `difyChatbotConfig` object can also contain other optional properties such as `isDev` and `baseUrl` which are used to configure the chatbot's environment and base URL respectively. Here is the relevant code snippet: ```js const difyChatbotConfig = window.difyChatbotConfig; if (!difyChatbotConfig || !difyChatbotConfig.token) { console.error('difyChatbotConfig is empty or token is not provided') return; } const isDev = !!difyChatbotConfig.isDev const baseUrl = difyChatbotConfig.baseUrl || `https://${isDev ? 'dev.' : ''}udify.app` ``` You can find more details in the [embed.js](https://github.com/langgenius/dify/blob/main/web/public/embed.js) file in the Dify codebase. ## Sources - [web/public/embed.js](https://github.com/langgenius/dify/blob/main/web/public/embed.js) --- This response is meant to be useful and save you time. It is **not meant to be a precise solution**, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot.
Author
Owner

@triumph commented on GitHub (Jan 25, 2024):

升级到 0.5.1 错误解决了, 感谢。

@triumph commented on GitHub (Jan 25, 2024): 升级到 0.5.1 错误解决了, 感谢。
Author
Owner

@crazywoola commented on GitHub (Jan 25, 2024):

Close due to https://github.com/langgenius/dify/issues/1542

@crazywoola commented on GitHub (Jan 25, 2024): Close due to https://github.com/langgenius/dify/issues/1542
Author
Owner

@crazywoola commented on GitHub (Jan 25, 2024):

@triumph Please use English to report an issue.

@crazywoola commented on GitHub (Jan 25, 2024): @triumph Please use English to report an issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#975