//这是我的html-routes.js文件中的内容:
app.get("/game", function(req, res) {
db.Questions.findAll({}).then(function(questions) {
res.render("game", {
test: "Yes",
triviaquestions: "../models/questions.js" // this is the issue I am having
});
});
console.log('hi');
[![enter image description here][1]][1]});
发布于 2019-03-27 04:08:22
这通常是因为您的models/index.js
(如果您正在使用生成器)试图自动导入models
中的所有内容,它正在拉入不是序列化模型的文件。在我的例子中,这是因为我在模型旁边有我的测试文件,并且它也在加载这些文件。检查其中是否没有任何非模型文件,或者更改models/index.js
以排除任何非模型文件(如测试)。
https://stackoverflow.com/questions/52324979
复制相似问题