Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug occurred about setting a custom timezone is not supported #35

Open
BaeJi77 opened this issue Oct 11, 2019 · 2 comments
Open

Bug occurred about setting a custom timezone is not supported #35

BaeJi77 opened this issue Oct 11, 2019 · 2 comments

Comments

@BaeJi77
Copy link

BaeJi77 commented Oct 11, 2019

I use sequelize version 5.19.2. and use mysql.
and set-up like below code.
There is in test file

const Database = require('../../models').sequelize;
    sequelizeMockingMocha(
        Database,
        path.resolve(path.join(__dirname, '../fake-trainer-database.json')),
        {'logging': console.log}
    );

There is in model set-up file

let sequelize;
if (config.use_env_variable) {
  sequelize = new Sequelize(process.env[config.use_env_variable], config);
} else {
  sequelize = new Sequelize(config.database, config.username, config.password, config);
}
...

db.sequelize = sequelize;
db.Sequelize = Sequelize;

db.Trainer = require('./trainer')(sequelize, Sequelize);

I don't know why this error happened.
Are there error in my code?
plz help me.

Error: Setting a custom timezone is not supported by SQLite, dates are always returned as UTC. Please remove the custom timezone parameter.
    at new Sequelize (node_modules/sequelize/lib/sequelize.js:273:13)
    at Function.create (node_modules/sequelize-mocking/lib/sequelize-mocking.js:95:31)
    at createAndLoadFixtureFile (node_modules/sequelize-mocking/lib/sequelize-mocking.js:123:14)
    at wrapper (node_modules/sequelize-mocking/node_modules/lodash/lodash.js:5193:19)
    at Context.<anonymous> (node_modules/sequelize-mocking/lib/sequelize-mocking-mocha.js:33:13)
    at processImmediate (internal/timers.js:439:21)
    at process.topLevelDomainCallback (domain.js:126:23)

TypeError: Cannot read property '__originalSequelize' of null
    at Function.unhookNewModel (node_modules/sequelize-mocking/lib/sequelize-mocking.js:277:29)
    at Function.restore (node_modules/sequelize-mocking/lib/sequelize-mocking.js:249:26)
    at Context.<anonymous> (node_modules/sequelize-mocking/lib/sequelize-mocking-mocha.js:43:18)
    at processImmediate (internal/timers.js:439:21)
    at process.topLevelDomainCallback (domain.js:126:23)
@BaeJi77 BaeJi77 changed the title I couldn't use because this issue. Setting a custom timezone is not supported Bug occurred about setting a custom timezone is not supported Oct 11, 2019
@rochejul
Copy link
Owner

Hi @BaeJi77
Could you provide a tiny zip with a sample to illustrate your issue?
What is the provided "config" object?
Here a thread around timezone and sequelize: sequelize/sequelize#854
Regards

@w4sevens
Copy link

i met the same question, and the error tips like this
------------Setting a custom timezone is not supported by SQLite, dates are always returned as UTC. Please remove the custom timezone parameter--------
need help ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants