Xiang Jaywhen
Xiang Jaywhen
程序员要耗子尾汁
> I'm also dealing with that problem.  yes, like @webwelten mentioned and the readme says, you should modified your next.config.js like this: ```JavaScript const withPWA = require('next-pwa')({ dest: 'public'...
hey, the readme has been updated, you can write like this: ```javascript const withPWA = require('next-pwa')({ customWorkerDir: 'serviceworker' ... }) module.exports = withPWA({ // next.js config }) ```
+1
> 看了官网的实例,似乎没办法获取到后端500报错的body中的detail,打印看过onopen中的response,似乎也没有参数能直接获取到 这个库的实现里面,会 - 先去执行fetch,拿到response, - 把上一步拿到的response传给onopen去执行 - 处理流数据 - 依次执行onclose,dispose,resolve(这部分可以不用细究) - 上面的几个步骤都在try中执行,catch住错误后如果不是内部主动中断请求,就会执行你传入的onerror 所以你如果希望获取到后端500报错的body中的detail,直接在onopen中从response中拿到即可(前提是你说的这个detail后端返回体中存在,假如你说的是后端返回的错误信息,我理解应该直接await response.json()即可拿到) > 而且我发现onopen不抛异常的话onerror是捕获不了请求500的错误 根据上面说的执行逻辑, 你需要在onopen中判断响应是否是500,是的话抛出,才能在onerror中去捕获到,onerror中不负责对响应进行校验
maybe should do some reg for user input https://github.com/usememos/memos/blob/595dbdb0ecb1eada129e21f1c1580d86dd256534/web/src/components/AskAIDialog.tsx#L61 perhaps like this: ```typescript await api.postChatCompletion(question.replace(/"|“|“/, '\\"')); ```
应该是改成了鼠标 hover 可见了,详见这个pr [1255](https://github.com/usememos/memos/pull/1255/files)