Chrome 66 + Webpack + Node: Breakpoints don’t stop the control flow

Do you want to request a feature or report a bug?

I’m reporting a bug.

What is the current behavior?

When inspecting a webpack-built bundle (running with Node) in Chrome, breakpoints are not triggered.
demonstration

If the current behavior is a bug, please provide the steps to reproduce.

I’ve created a reproduce repository on GitLab.

Clone that repository, then:

  1. npm i
  2. ./node_modules/.bin/webpack --mode development app.js -o out.js
  3. node --inspect-brk out.js
  4. Open Chrome and go to chrome://inspect
  5. Click “Open dedicated DevTools for Node”
  6. Ensure you’re on the “Sources” tab
  7. Click the blue “resume script execution” button – the control flow will continue, then pause at the debugger line in app.js, which is good.
  8. In the middle pane, put a breakpoint on the line with the console.log (click the grey “3”)
  9. Click the blue “resume script execution” button again – the control flow should stop at your breakpoint on the console.log. Instead, it continues, prints the log, doesn’t stop, and finishes execution.

What is the expected behavior?

Breakpoints should stop the control flow.

Please mention other relevant information such as the browser version, Node.js version, webpack version, and Operating System.

Note that this functionality was working 💯-ly on Chrome 65, the recent Chrome 66 changes have broken this. I’m reporting this under the webpack issue tracker because non-webpack-ify’d files still work properly in the Chrome Node debugger.

  • Chrome: 66.0.3359.117
  • Node: v8.10.0
  • NPM: 5.6.0
  • OS: Arch Linux / macOS 10.13.4
  • Webpack 4.6.0

Author: Fantashit

1 thought on “Chrome 66 + Webpack + Node: Breakpoints don’t stop the control flow

  1. Note that setting the devtool to source-map is a functional workaround, at a cost to build time.

    So, if you’re using the cli: webpack --devtool source-map ...
    Or via the webpack.config.js file:

    {
        // ...
        devtool: 'source-map'
    }
    

Comments are closed.