Issue with Sequelize seeding Dialect error

I'm trying to seed my database with an npm script.

  "scripts": {
    "devstart": "set NODE_ENV=development && sequelize db:seed:all && nodemon ./server.js"
  }

I keep getting an error saying that I have to explicitly define the dialect in my config. This is my config file:

{
 "development": {
    "use_env_variable": "LOCALDB",
    "dialect": "mysql"
 },
 "test": {
    "username": "root",
    "password": null,
    "database": "database_test",
    "host": "127.0.0.1",
    "dialect": "mysql"
 },
 "production": {
    "use_env_variable": "JAWSDB_URL",
    "dialect": "mysql"
 }
}

Not entirely sure what I am doing wrong. :/

728x90

1 Answers Issue with Sequelize seeding Dialect error

You must export your configuration:

module.exports = {
 "development": {
    "use_env_variable": "LOCALDB",
    "dialect": "mysql"
 },
 "test": {
    "username": "root",
    "password": null,
    "database": "database_test",
    "host": "127.0.0.1",
    "dialect": "mysql"
 },
 "production": {
    "use_env_variable": "JAWSDB_URL",
    "dialect": "mysql"
 }
}

5 months ago