【问题标题】:What is this "defineCall is not a function" error that I am getting?我得到的这个“defineCall 不是函数”错误是什么?
【发布时间】:2019-03-27 04:08:22
【问题描述】:

//这是我的“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]});

【问题讨论】:

    标签: sequelize.js


    【解决方案1】:

    这通常是因为您的models/index.js(如果您使用生成器)试图自动导入models 中的所有内容,正在拉入不是 Sequelize 模型的文件。就我而言,这是因为我在模型旁边有我的测试文件,并且它也在加载这些文件。检查那里没有任何非模型文件,或更改models/index.js 以排除任何不是模型的内容(如测试)。

    【讨论】:

      猜你喜欢
      • 2018-09-09
      • 2018-04-15
      • 1970-01-01
      • 1970-01-01
      • 2021-07-07
      • 1970-01-01
      • 1970-01-01
      • 2016-07-08
      • 1970-01-01
      相关资源
      最近更新 更多