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

Chrome debugger within the js file? #39

Open
fr-nevin opened this issue Apr 10, 2019 · 0 comments
Open

Chrome debugger within the js file? #39

fr-nevin opened this issue Apr 10, 2019 · 0 comments

Comments

@fr-nevin
Copy link

fr-nevin commented Apr 10, 2019

I was wondering how to debug the data coming back from the then function within :


`exports.up = function(db) {
  var filePath = path.join(__dirname, 'sqls', '20190409095035-data-migration-region-up.sql');
  return new Promise( function( resolve, reject ) {
    fs.readFile(filePath, {encoding: 'utf-8'}, function(err,data){
      if (err) return reject(err);
      console.log('received data: ' + data);
      resolve(data);
    });
  })
  .then(function(data) {
    **debugger**; // -> Wanted to put the chrome debugger here for node.js
    return db.runSql(data);
  });
};`

I tried something like:

node --inspect-brk config/migrations/20190409095035-data-migration-region.js

to get a hook in the file. It triggered the basic breakpoint, but once the command:

db-migrate up --migrations-dir config/migrations --config config/database.js --env dev

runs, it doesn't get hooked in the debug listener.

Any suggestions on how to get the instance to get hooked?


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

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

1 participant