sequelize: Documentation error: Sequelize option "dialect" is not optional?

What you are doing?

Using Sequelize in v4.3.2. I didn’t provide a dialect in the Options object for the constructor. That results in

node_modules/sequelize/lib/sequelize.js:169
      throw new Error('Dialect needs to be explicitly supplied as of v4.0.0');
      ^

What do you expect to happen?

According to the docs the dialect is optional and should default to 'mysql'.

What is actually happening?

Error as listed above.

Dialect: mysql Database version: 5.5 Sequelize version: 4.3.2

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 17 (2 by maintainers)

Most upvoted comments

I’ve been having issues with it as well. In my config file I have

    "dialect": "mysql"

I’m still getting the “Error: Dialect needs to be explicitly supplied as of v4.0.0”. Very frustrating and can’t figure out why Sequelize doesn’t see my specifying the dialect.

I also faced the same issue.

Having this same issue " throw new Error(‘Dialect needs to be explicitly supplied as of v4.0.0’)" and dialect has been specified in my config.Json file…

It worked for me on windows by adding following in config.json

“NODE_ENV”:“development”, “dialect”:“mysql”

var connection = new Sequelize(‘database,’ user’, ‘password’,{ host: ‘localhost’, dialect: ‘mysql’ });

I’m getting this as well. I just started using sequelize. I’m not sure what’s wrong. I tried setting my files up like this https://gist.github.com/andrewmunro/030f0bf62453239c495b0347c8cd1247#file-how-to-use-md.

face the same issue and fixed it by setting the NODE_ENV to the specified environment in the config.json