acdlite / flummox

Minimal, isomorphic Flux.
http://acdlite.github.io/flummox
1.69k stars 114 forks source link

Actions.js grabs all console logs #264

Open chetanism opened 9 years ago

chetanism commented 9 years ago

I am using react-dnd library which uses dnd-core library which uses the flummox library (phew). The problem I am facing is that under chrome browser all my logs/errors/warnings are shown to be logged from Actions.js. This is very frustrating because now I don't see the filename/line number where error is. Under Safari, same issue happens but with Flux.js. It works fine with Firefox.

Please let me know if there is a workaround for this problem. Please see the attached image:

screen shot 2015-07-17 at 1 23 16 pm

Thanks, chetan.

gaearon commented 9 years ago

Flummox, from what I know, doesn't override console methods or anything. Any chance your build tool (responsible for source maps) is configured incorrectly or is at a buggy version?

chetanism commented 9 years ago

I feel that you are right for two reasons:

  1. I am using webpack, and there is another issue: https://github.com/acdlite/flummox/issues/194 that points out a similar issue (I may be wrong) with webpack. I tried the workaround mentioned on the issue, but it didn't help.
  2. In another project I am using browserify, and I don't see the problem there.

Frankly speaking, I don't have much idea about what's going on under the hood. I tried several things, but nothing helped. On my part, I will try:

  1. Building my project using browserify to confirm if the problem is indeed with webpack
  2. To build a simple project with webpack and react-dnd that reproduces the problem and share it here.

A couple of other things that I noticed, not sure if it helps, but just in case:

  1. Actions.js is loaded separately (as shown under sources). I don't see it in networks tab, or any code line requesting it, it just magically appears there.
  2. If I put any breakpoint in my source, debugger puts the breakpoint at Actions.js: 119 (which is the last line of the file)
gaearon commented 9 years ago

Can you try changing devtool in your Webpack config to 'eval'? This sure looks like a broken source map.

jkusachi commented 9 years ago

Experiencing the same

@chetanism for the time being, you can disable JS Sourcemaps in Chrome Dev Tools and you should get it working again, getting logs and debugger statements on the correct line numbers