Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jsx react debugger not matching despite webpack source maps

I'm learning React and JSX and using webpack to compile but when I throw in 'debugger' into my component, the line isn't matched when I'm in Chrome Dev Tools' Sources tab (in general the sources doesn't reflect what I have in my app.jsx file at all). The React tab doesn't really load up either. Below is my webpack.config:

module.exports = {
  context: __dirname,
  entry: "./api_assignment.jsx",
  output: {
    path: "./",
    filename: "bundle.js"
  },
  module: {
    loaders: [
      {
        test: /\.jsx?$/,
        exclude: /node_modules/,
        loader: 'babel',
        query: {
          presets: ['react']
        }
      }
    ]
  },
  devtool: 'source-map',
  resolve: {
    extensions: ["", ".js", ".jsx"]
  }
};

enter image description here

//Webpack screenshot

enter image description here

enter image description here

like image 562
akantoword Avatar asked Mar 12 '16 23:03

akantoword


1 Answers

If you are loading your html from local file and not webpack server, you need to enable React Developer Tools extension option "Allow access to file URLs".

like image 174
Dauren Akilbekov Avatar answered Oct 16 '22 08:10

Dauren Akilbekov