discussjs / discuss

一款简单,安全,免费的评论系统 | A simple, safe, free comment system
https://discuss.js.org
MIT License
78 stars 14 forks source link

服务器部署时执行'node index.js'运行失败 #25

Open spencer-luo opened 3 months ago

spencer-luo commented 3 months ago

TypeError: Cannot read properties of undefined (reading 'setHeader')

discuss_run_error

spencer-luo commented 3 months ago

Node.js: v20.9.0 Operation: MacOS 14.5

已配置MySQL数据库

Lete114 commented 3 months ago

你能提供一下你的index.js和package.json的内容吗?

spencer-luo commented 3 months ago
image image
Lete114 commented 3 months ago

index.js的内容是这样的吗?

const discuss = require('discuss')

// 选择以什么方式运行
discuss.server() // 服务器使用 (Server)
spencer-luo commented 3 months ago

是的:

const discuss = require('discuss')

// 选择以什么方式运行 discuss.server() // 服务器使用 (Server)

discuss.main() // 无服务器使用 (ServerLess)

Lete114 commented 3 months ago

不需要 discuss.main()