1
I get the error RangeError: Maximum call stack size exceeded
in my model statement. Follow code below:
const { Model, DataTypes } = require('sequelize')
class Usuario extends Model {
static init(sequelize) {
Usuario.init({
nome: DataTypes.STRING,
nascimento: DataTypes.DATE,
genero: DataTypes.ENUM('masculino', 'feminino'),
email: DataTypes.STRING,
disponibilidade: DataTypes.ENUM('presencial', 'online'),
biografia: DataTypes.STRING,
foto_perfil: DataTypes.STRING
}, {sequelize})
}
}
module.exports = Usuario;
The error message:
C:\Users\helde\Documents\TCC\node_modules\sequelize\lib\data-types.js:739
constructor(...args) {
^
RangeError: Maximum call stack size exceeded
at new ENUM (C:\Users\helde\Documents\TCC\node_modules\sequelize\lib\data-types.js:739:14)
at Object.apply (C:\Users\helde\Documents\TCC\node_modules\sequelize\lib\utils\class-to-invokable.js:14:14)
at Function.init (C:\Users\helde\Documents\TCC\src\models\Usuario.js:8:31)
at Function.init (C:\Users\helde\Documents\TCC\src\models\Usuario.js:5:17)
at Function.init (C:\Users\helde\Documents\TCC\src\models\Usuario.js:5:17)
at Function.init (C:\Users\helde\Documents\TCC\src\models\Usuario.js:5:17)
at Function.init (C:\Users\helde\Documents\TCC\src\models\Usuario.js:5:17)
at Function.init (C:\Users\helde\Documents\TCC\src\models\Usuario.js:5:17)
at Function.init (C:\Users\helde\Documents\TCC\src\models\Usuario.js:5:17)
at Function.init (C:\Users\helde\Documents\TCC\src\models\Usuario.js:5:17)
when I leave so and using an index function to return all users of the database of the other bug (Node:10908) Unhandledpromiserejectionwarning: Sequelizedatabaseerror: Table 'dh_quero_materia.usuarios' doesn’t exist
– Helder_dsA
Can you create another question and show the bug log? It will be easier to help. Now you have to see how the user table is being created.
– Cmte Cardeal