相关疑难解决方法(0)

首先Heroku部署失败`错误代码= H10`

我将我的应用程序部署到了Heroku.这是一个node.js + express + socket.io app,这是package.json文件

{
  "name": "game_test",
  "author": "Ilya",
  "description": "A test app for our board game",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node app"
  },
  "dependencies": {
    "express": "3.0.6",
    "jade": "*",
    "socket.io" : "*"
  },
 "engines": {
      "node": "0.8.14"
  }
}
Run Code Online (Sandbox Code Playgroud)

这是我得到的日志:

heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=game-test-1.herokuapp.com fwd=37.26.146.185 dyno= queue= wait= connect= service= status=503 bytes=
heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=game-test-1.herokuapp.com fwd=37.26.146.185 dyno= queue= wait= connect= service= status=503 bytes= …
Run Code Online (Sandbox Code Playgroud)

heroku node.js express

76
推荐指数
6
解决办法
10万
查看次数

如何修复错误(TypeError:无法分配给对象“#<QueryCursor>”的只读属性“map”)

我通过 Mongoose 将数据发送到 MongoDB。现在,在为其获取 API 路由期间,会抛出错误。

代码

const addChoice = async (e) => {
    try {
        e.preventDefault();
        const res = await fetch("/api/sendChoice", {
            method: "POST",
            headers: {
                "Content-Type": "application/json",
            },
            body: JSON.stringify({
                choiceSeq: choice,
                checkSubmit: true,
            }),
        });
        console.log(res);
        router.push("/home");
    } catch (error) {
        console.log(error);
    }
};
Run Code Online (Sandbox Code Playgroud)

错误发生在const res = await fetch("/api/sendChoice" ,{

在终端服务器中出现错误

错误 - TypeError:无法分配给对象“#<QueryCursor>”的只读属性“map”

在检查元素中,错误如下
这

我找不到与解决此问题相关的任何内容,我什至不明白该错误意味着什么,试图自己解决它。

我的项目中的其他一些相关代码:

api/sendChoice

import { getSession } from "next-auth/client";
import dbConnect from "../../helpers/dbConnect";
import Choice from "../../models/Choice";

export default async function …
Run Code Online (Sandbox Code Playgroud)

typeerror fetch mongoose mongodb next.js

10
推荐指数
3
解决办法
8166
查看次数

标签 统计

express ×1

fetch ×1

heroku ×1

mongodb ×1

mongoose ×1

next.js ×1

node.js ×1

typeerror ×1