You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
process.env.NODE_ENV might be undefined and require('babel-plugin-require-context-hook/register')() might not be called. Try adding console.log(process.env.NODE_ENV) above it.
Getting this error, when it's looking for the process.env.NODE_ENV before the require.context is called in the models index.js file
if (process.env.NODE_ENV === 'development') {
require('babel-plugin-require-context-hook/register')();
}
export default (sequelize) => {
let db = {};
const context = require.context('.', true, /^./(?!index.js).*.js$/, 'sync');
context
.keys()
.map(context)
.forEach((module) => {
const model = module(sequelize, Sequelize);
db[model.name] = model;
});
Object.keys(db).forEach((modelName) => {
if (db[modelName].associate) {
db[modelName].associate(db);
}
});
return db;
};
The text was updated successfully, but these errors were encountered: