---
# System prepended metadata

title: '[Solved]: Argument is not defined [model/index.js]'
tags: [debug, solved]

---

###### tags: `solved` `debug`

[Solved]: Argument is not defined [model/index.js]
===
## 報錯訊息:
ReferenceError: sequelize is not defined
    at Object.<anonymous> (C:\Users\329058\Desktop\others\KnowledgeManager\****stembase\model\index.js:19****:42)
    at Module._compile (node:internal/modules/cjs/loader:1159:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
    at Module.load (node:internal/modules/cjs/loader:1037:32)
    at Module._load (node:internal/modules/cjs/loader:878:12)
    at Module.require (node:internal/modules/cjs/loader:1061:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at Object.<anonymous> (C:\Users\329058\Desktop\others\KnowledgeManager\****stembase\server.js:18****:12)
    at Module._compile (node:internal/modules/cjs/loader:1159:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
    
## 解決過程:
    1. 將model\stemdb.model.js 中:
*module.exports = (sequelizze,Sequelize)* 重新命名為*module.exports = (**sequelize**,Sequelize)* 

## 成因猜測[確信]:
    1. index.js 具有*db.stemdb = require('./stemdb.model.js')(sequelize,Sequelize);*，此段程式碼指定將model/stemdb.model.js中兩變數sequelize、Sequelize引入，然因stem/stemdb.model.js中sequelize被錯誤的宣告為sequelizze造成，未定義的錯誤。
    
    
## 注釋:
    1. 同一般的定義錯誤，然而實際錯誤檔案並非顯示執行歷程中的任一檔案。
    2. require 不會被視為執行歷程之主程式流之一，除非錯誤源於require 的檔案本身。
    

