walinejs / waline

💬 A Simple, Safe Comment System
https://waline.js.org/en/
GNU General Public License v2.0
2.29k stars 404 forks source link

[Bug]: 按照官网,无法在vercel部署成功 500错误 #1334

Closed hxer520 closed 2 years ago

hxer520 commented 2 years ago

问题描述 | Describe the bug

image

按照官网,无法在vercel部署成功 500错误

问题网站 | Website URL

https://waline-vercel-self.vercel.app/

服务部署在哪里? | Where your waline deploy?

Vercel (Default)

数据存储在哪里?| Where your comment data store?

LeanCloud(https://leancloud.cn)

Mister-Hope commented 2 years ago

Are you setting env variables and rebooting the service later?

lizheming commented 2 years ago

去后台截图看下日志吧

idelin commented 2 years ago

[GET] / 16:41:09:94 2022-08-30T08:41:10.638Z undefined ERROR Cannot find module 'think-model-mysql' Require stack:

idelin commented 2 years ago

确实也不行,我是之前部署的,之前是好的,今天去重新 redeloy了一下,就不行了,前台显示跟这一样,后台报错显示这个

CCKNBC commented 2 years ago

加一 昨晚更改了环境变量 重新部署就这样了

hxer520 commented 2 years ago

Are you setting env variables and rebooting the service later? sure

hxer520 commented 2 years ago

去后台截图看下日志吧 @lizheming 我日志的情况 @idelin 和她的一样

hxer520 commented 2 years ago

这个事构建日志: [21:31:15.473] Cloning github.com/hxer520/waline-vercel (Branch: main, Commit: 83ef7ef) [21:31:15.995] Cloning completed: 522.145ms [21:31:16.741] No Build Cache available [21:31:16.965] Running "vercel build" [21:31:17.511] Vercel CLI 28.2.0 [21:31:17.605] WARN! Due to builds existing in your configuration file, the Build and Development Settings defined in your Project Settings will not apply. Learn More: https://vercel.link/unused-build-settings [21:31:18.128] Installing dependencies... [21:31:18.475] yarn install v1.22.17 [21:31:18.504] info No lockfile found. [21:31:18.509] [1/4] Resolving packages... [21:31:19.939] warning @waline/vercel > akismet > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142 [21:31:19.939] warning @waline/vercel > @cloudbase/node-sdk > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142 [21:31:20.271] warning @waline/vercel > leancloud-storage > uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. [21:31:20.272] warning @waline/vercel > think-helper > uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. [21:31:20.272] warning @waline/vercel > akismet > request > uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. [21:31:20.272] warning @waline/vercel > leancloud-storage > leancloud-realtime > uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. [21:31:20.801] warning @waline/vercel > @cloudbase/node-sdk > request-promise@4.2.6: request-promise has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142 [21:31:21.624] warning @waline/vercel > akismet > request > har-validator@5.1.5: this library is no longer supported [21:31:22.611] warning @waline/vercel > thinkjs > think-payload > formidable@1.2.6: Please upgrade to latest, formidable@v2 or formidable@v3! Check these notes: https://bit.ly/2ZEqIau [21:31:22.840] warning @waline/vercel > @cloudbase/node-sdk > @cloudbase/signature-nodejs > url > querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead. [21:31:22.938] warning @waline/vercel > leancloud-storage > @leancloud/platform-adapters-node > @leancloud/adapters-superagent > superagent@5.3.1: Please upgrade to v7.0.2+ of superagent. We have fixed numerous issues with streams, form-data, attach(), filesystem errors not bubbling up (ENOENT on attach()), and all tests are now passing. See the releases tab for more information at https://github.com/visionmedia/superagent/releases. [21:31:22.941] warning @waline/vercel > leancloud-storage > @leancloud/platform-adapters-node > @leancloud/adapters-superagent > superagent > formidable@1.2.6: Please upgrade to latest, formidable@v2 or formidable@v3! Check these notes: https://bit.ly/2ZEqIau [21:31:23.861] [2/4] Fetching packages... [21:31:31.292] [3/4] Linking dependencies... [21:31:31.294] warning "@waline/vercel > @cloudbase/node-sdk > ts-node@8.10.2" has unmet peer dependency "typescript@>=2.7". [21:31:37.233] [4/4] Building fresh packages... [21:31:38.019] success Saved lockfile. [21:31:38.023] Done in 19.55s. [21:31:40.081] Build Completed in /vercel/output [22s] [21:31:44.281] Generated build outputs: [21:31:44.281] - Static files: 0 [21:31:44.281] - Serverless Functions: 1 [21:31:44.281] - Edge Functions: 0 [21:31:44.281] Serverless regions: Washington, D.C., USA [21:31:44.281] Deployed outputs in 3s [21:31:45.667] Build completed. Populating build cache... [21:31:55.076] Uploading build cache [34.66 MB]... [21:31:56.475] Build cache uploaded: 1.399s [21:31:56.509] Done with "."

hxer520 commented 2 years ago

以下这个是log

[GET] / 21:31:47:09 2022-08-30T13:31:48.183Z undefined ERROR Cannot find module 'think-model-mysql' Require stack:

Ran-Xing commented 2 years ago

+1

cppxiaozhu commented 2 years ago

me too

qinyuanpei commented 2 years ago

I try to add think-model-mysql to the package.json, but it is useless.

fanke15 commented 2 years ago

undefined ERROR Cannot find module 'think-model-mysql'

一样的报错。 昨天按照官网文档配置,国内,四个环境变量全部设置。 重试了三次。

截屏2022-08-31 11 50 16

docker实测运行正常

JokerZhang66 commented 2 years ago

+1

lizheming commented 2 years ago

https://github.com/vercel/vercel/discussions/8494 Waline 这边排查不太出来了,给 Vercel 提 discussion 了,等回复中

Vincentqyw commented 2 years ago

same issue, waiting for a solution.

idelin commented 2 years ago

vercel/vercel#8494 Waline 这边排查不太出来了,给 Vercel 提 discussion 了,等回复中

回复了,怎么说

image

lizheming commented 2 years ago

有问题的同学重新部署一下,应该是 @vercel/node 新版引入的 Bug,目前指定到老版本可以正常部署。

elkan1788 commented 2 years ago

有问题的同学重新部署一下,应该是 @vercel/node 新版引入的 Bug,目前指定到老版本可以正常部署。

指定到哪个老版本呢?测试过1.18.x1.17.x都不行哦

qinyuanpei commented 2 years ago

请修改你的 vercel.json 文件,并将 @vercel/node 回退到上一个版本,可以通过命令 npm view @vercel/node versions 查看

{
  "name": "comment",
  "github": {
    "silent": true
  },
  "builds": [
    {
      "src": "index.js",
      "use": "@vercel/node@2.5.10"
    }
  ],
  "routes": [
    {
      "src": "/(.*)",
      "dest": "index.js"
    }
  ]
}

重新部署后即可恢复,万万没想到是 Vercel 出现了问题

图片

lizheming commented 2 years ago

有问题的同学重新部署一下,应该是 @vercel/node 新版引入的 Bug,目前指定到老版本可以正常部署。

指定到哪个老版本呢?测试过1.18.x1.17.x都不行哦

看清楚是 @verce/node 不是 @waline/vercel,已经部署的同学可以参考 https://github.com/walinejs/waline/commit/8c947a70bd29861d82397b29d734b40222ee0b84 这个 commit 修改(其实就是加了个版本号

Ran-Xing commented 2 years ago

@lizheming 大佬,能否指教下fock仓库之后怎么直接部署? 我在vercel里面设置npm run server:dev会报错, 为什么fork呢?方便及时更新最新版

CCKNBC commented 2 years ago

@lizheming 大佬,能否指教下fock仓库之后怎么直接部署? 我在vercel里面设置npm run server:dev会报错, 为什么fork呢?方便及时更新最新版

https://vercel.com/import/project?template=https://github.com/Ran-Xing/waline/tree/main/example

Ran-Xing commented 2 years ago

image 我说的是这个,抱歉 @CCKNBC

Ran-Xing commented 2 years ago

解决了 @CCKNBC Vercel Root Directory 谢谢

Ran-Xing commented 2 years ago
[GET] /
08:09:49:02
RequestId: bb2b93e2-cf78-4a08-8c87-410a333b53a0 Error: Runtime exited with error: exit status 1
Runtime.ExitError
2022-10-06T00:09:49.718Z    undefined   ERROR   Cannot find module '@waline/vercel'
Require stack:
- /var/task/example/index.js
2022-10-06T00:09:49.719Z    undefined   ERROR   Did you forget to add it to "dependencies" in `package.json`?
RequestId: 7cbc3da0-5c25-4a4f-bcd4-150f31afa833 Error: Runtime exited with error: exit status 1
Runtime.ExitError
[GET] /
08:09:46:68
RequestId: 265e0ea9-a071-4bfe-8823-281f28ae50b7 Error: Runtime exited with error: exit status 1
Runtime.ExitError
2022-10-06T00:09:45.041Z    undefined   ERROR   Cannot find module '@waline/vercel'
Require stack:
- /var/task/example/index.js
2022-10-06T00:09:45.041Z    undefined   ERROR   Did you forget to add it to "dependencies" in `package.json`?
2022-10-06T00:09:47.372Z    undefined   ERROR   Cannot find module '@waline/vercel'
Require stack:
- /var/task/example/index.js
2022-10-06T00:09:47.372Z    undefined   ERROR   Did you forget to add it to "dependencies" in `package.json`?
RequestId: bb2b93e2-cf78-4a08-8c87-410a333b53a0 Error: Runtime exited with error: exit status 1
Runtime.ExitError

这个问题又出现了, Root Directory:example 其他的都是默认值 环境变量是 9.6 设置的,没动

放弃了,deta 挺香的

zhaocai-ally commented 11 months ago

500错误无法注册 独立部署 npm直接安装 2023-12-04_08-20

xylcbd commented 11 months ago

我也碰到了这个问题,后面解决了。原因是我的环境变量命名错误了,我部署在lean clound上,环境变量名字应该是LEAN_ID而不是AppKey,其他两个变量同理。


I also encountered this problem and solved it later. The reason is that my environment variable name is wrong. I deployed it on lean clound. The environment variable name should be LEAN_ID instead of AppKey. The other two variables are the same.

lanhui672 commented 7 months ago

环境变量配置错了/。也无法注册。 我弄好了https://www.lanhui.live/post/2/


The environment variables are configured incorrectly/. Can't register either. I've done it https://www.lanhui.live/post/2/

lanhui672 commented 7 months ago

我也碰到了这个问题,后面解决了。原因是我的环境变量命名错误了,我部署在lean clound上,环境变量名字应该是LEAN_ID而不是AppKey,其他两个变量同理。

I also encountered this problem and solved it later. The reason is that my environment variable name is wrong. I deployed it on lean clound. The environment variable name should be LEAN_ID instead of AppKey. The other two variables are the same.

对,网上有些人教程 这里写错了

lanhui672 commented 7 months ago

500错误无法注册 独立部署 npm直接安装 2023-12-04_08-20

https://www.lanhui.live/post/2/看这里解决


500 error cannot register independent deployment npm direct installation! [2023-12-04_08-20](https://private-user-images.githubusercontent.com/54318393/287561698-629728be-f06d-4676-b808-8514bcc9d16f.png ?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..hHyrJww6dfwYOhLB8KpJ9lGn6zmNVRFLR5jZj_AXSNQ)

https://www.lanhui.live/post/2/See the solution here