{"action":"opened","issue":{"url":"https://api.github.com/repos/babel/babel/issues/9280","repository_url":"https://api.github.com/repos/babel/babel","labels_url":"https://api.github.com/repos/babel/babel/issues/9280/labels{/name}","comments_url":"https://api.github.com/repos/babel/babel/issues/9280/comments","events_url":"https://api.github.com/repos/babel/babel/issues/9280/events","html_url":"https://github.com/babel/babel/issues/9280","id":396140765,"node_id":"MDU6SXNzdWUzOTYxNDA3NjU=","number":9280,"title":"TypeError: Class constructor model cannot be invoked without 'new' after uninstalling babel","user":{"login":"ekkatharisi","id":35816934,"node_id":"MDQ6VXNlcjM1ODE2OTM0","avatar_url":"https://avatars3.githubusercontent.com/u/35816934?v=4","gravatar_id":"","url":"https://api.github.com/users/ekkatharisi","html_url":"https://github.com/ekkatharisi","followers_url":"https://api.github.com/users/ekkatharisi/followers","following_url":"https://api.github.com/users/ekkatharisi/following{/other_user}","gists_url":"https://api.github.com/users/ekkatharisi/gists{/gist_id}","starred_url":"https://api.github.com/users/ekkatharisi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ekkatharisi/subscriptions","organizations_url":"https://api.github.com/users/ekkatharisi/orgs","repos_url":"https://api.github.com/users/ekkatharisi/repos","events_url":"https://api.github.com/users/ekkatharisi/events{/privacy}","received_events_url":"https://api.github.com/users/ekkatharisi/received_events","type":"User","site_admin":false},"labels":[{"id":440210152,"node_id":"MDU6TGFiZWw0NDAyMTAxNTI=","url":"https://api.github.com/repos/babel/babel/labels/i:%20bug","name":"i: bug","color":"e99695","default":false},{"id":560986419,"node_id":"MDU6TGFiZWw1NjA5ODY0MTk=","url":"https://api.github.com/repos/babel/babel/labels/i:%20needs%20triage","name":"i: needs triage","color":"ededed","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2019-01-05T07:01:57Z","updated_at":"2019-01-05T07:01:57Z","closed_at":null,"author_association":"NONE","body":"## Bug Report\r\n\r\n**Current Behavior**\r\ni have a trouble using babel , and when i unistalling it to use just the ES5 , it shoots this error : \r\nTypeError: Class constructor model cannot be invoked without 'new'\r\nthis is my code :\r\n**Input Code**\r\n        const fs = require('fs');\r\n        const path = require('path'); \r\n        const Sequelize = require('sequelize');\r\n        const basename = path.basename(__filename);\r\n        const env = 'development';\r\n        const config = require('../config/config')[env];\r\n\r\n           const sequelize  = new Sequelize(config.database.database_name, config.database.username, \r\n           config.database.password, config.database.database_config);\r\n\r\n      var db = {\r\n         sequelize : sequelize,\r\n         Sequelize : Sequelize\r\n      };\r\n\r\n        db.sequelize.authenticate().then(() => {\r\n        console.log('database worked !!!');\r\n\r\n\r\n    fs.readdirSync(path.join(__dirname,'models/')).filter(file => {\r\n        return (file.indexOf('.') !== 0) && (file !== basename) && (file.slice(-3) === '.js');\r\n    }).forEach(file => {\r\n        var model = db.sequelize.import(path.join(__dirname,\"models/\", file));\r\n        //var model = require(path.join(__dirname,\"models/\", file))(sequelize, Sequelize);\r\n        db[model.name] = model;\r\n    });\r\n\r\n       Object.keys(db).forEach(modelName => {\r\n           if (db[modelName].associate) {\r\n               db[modelName].associate(db);\r\n          }\r\n         } );\r\n       db.sequelize.sync({force : true}).then(res => {\r\n           console.log('database created !!!!!!!!!');\r\n      }).catch(err => {\r\n           console.log(err.stack);\r\n     })\r\n        }).catch(error => {\r\n            console.log(error.stack);\r\n       });\r\n       module.exports = db;\r\n\r\nplease what i should do now ??\r\n\r\n**Environment**\r\n- Babel version(s): [e.g. v6.0.0, v7.0.0-beta.34]\r\n- Node/npm version: [e.g. Node 10.14.2/npm 6.4.1]\r\n- OS: [Windows 10]\r\n- How you are using Babel: [`cli`]"}}
{"actor":{"display_login":"ekkatharisi"}}