chatgpt-web-dev / chatgpt-web

A third-party ChatGPT Web UI page built with Express and Vue3, through the official OpenAI completion API. / 用 Express 和 Vue3 搭建的第三方 ChatGPT 前端页面, 基于 OpenAI 官方 completion API.
https://chatgpt-web.dev
MIT License
1.61k stars 441 forks source link

FIX: no mail is being sent to user #405

Closed Urmi10799 closed 8 months ago

Urmi10799 commented 8 months ago

As tsx is used for backend __dirname is failed to solve at mail.ts showing error: __dirname is not defined. As a result signup and reset password isn't possible and mail is failed to send to user. This can be fixed by this following code. I highly encourage to implement this fix as soon as possible.

mail.ts:

import { fileURLToPath } from 'node:url'
import { dirname } from 'node:path'

const __dirname = dirname(fileURLToPath(import.meta.url))

Dockerfile:

COPY --from=backend /app/src/utils/templates /app/build/utils/templates