I am currently working with Sequelize.js (version 4.38.0) in conjunction with Typescript (version 3.0.3). Additionally, I have installed the package @types/sequelize at version 4.27.25.
The issue I am facing involves the inability to transpile the following code:
import Sequelize from 'sequelize'
const sequelize = new Sequelize('...');
const model = sequelize.define('Model', {a: Sequelize.INTEGER, b: Sequelize.INTEGER});
var instance = model.build({a: 1, b:1});
instance.save();
Upon compilation using tsc, the error message received states:
Property 'save' does not exist on type '{}'.
It seems that the build method is returning an empty object for some reason. Attempting to use create instead results in the same error: a Promise is returned which resolves to an empty object.
Any insights or thoughts on this issue would be greatly appreciated.