Skip to content

Load the source map before displaying the error - #94

Closed
borela wants to merge 11 commits into
commissure:masterfrom
borela:feature/load-source-map
Closed

borela wants to merge 11 commits into
commissure:masterfrom
borela:feature/load-source-map

Conversation

@borela

@borela borela commented May 29, 2017 •

Copy link
Copy Markdown
Contributor

Fixes #84

Webpack settings:

  • eval
  • cheap-eval-source-map
  • cheap-source-map
  • cheap-module-eval-source-map
  • cheap-module-source-map
  • eval-source-map
  • source-map

source map

Stack examples:

eval
ReferenceError: lol is not defined
    at App.render (webpack:///./src/App.js?:92:7)
    at App.render (webpack:///./~/react-proxy/modules/createPrototypeProxy.js?:44:30)
    at eval (webpack:///./~/react-dom/lib/ReactCompositeComponent.js?:796:21)
    at measureLifeCyclePerf (webpack:///./~/react-dom/lib/ReactCompositeComponent.js?:75:12)
    at ReactCompositeComponentWrapper._renderValidatedComponentWithoutOwnerOrContext (webpack:///./~/react-dom/lib/ReactCompositeComponent.js?:795:25)
    at ReactCompositeComponentWrapper._renderValidatedComponent (webpack:///./~/react-dom/lib/ReactCompositeComponent.js?:822:32)
    at ReactCompositeComponentWrapper.performInitialMount (webpack:///./~/react-dom/lib/ReactCompositeComponent.js?:362:30)
    at ReactCompositeComponentWrapper.mountComponent (webpack:///./~/react-dom/lib/ReactCompositeComponent.js?:258:21)
    at Object.mountComponent (webpack:///./~/react-dom/lib/ReactReconciler.js?:46:35)
    at ReactCompositeComponentWrapper.performInitialMount (webpack:///./~/react-dom/lib/ReactCompositeComponent.js?:371:34)



cheap-eval-source-map
ReferenceError: lol is not defined
    at App.render (eval at ./src/App.js (http://localhost:3000/script.js?8f8500a7:6210:1), <anonymous>:92:7)
    at App.render (eval at ./node_modules/react-proxy/modules/createPrototypeProxy.js (http://localhost:3000/script.js?8f8500a7:5431:1), <anonymous>:44:30)
    at eval (eval at ./node_modules/react-dom/lib/ReactCompositeComponent.js (http://localhost:3000/script.js?8f8500a7:4553:1), <anonymous>:796:21)
    at measureLifeCyclePerf (eval at ./node_modules/react-dom/lib/ReactCompositeComponent.js (http://localhost:3000/script.js?8f8500a7:4553:1), <anonymous>:75:12)
    at ReactCompositeComponentWrapper._renderValidatedComponentWithoutOwnerOrContext (eval at ./node_modules/react-dom/lib/ReactCompositeComponent.js (http://localhost:3000/script.js?8f8500a7:4553:1), <anonymous>:795:25)
    at ReactCompositeComponentWrapper._renderValidatedComponent (eval at ./node_modules/react-dom/lib/ReactCompositeComponent.js (http://localhost:3000/script.js?8f8500a7:4553:1), <anonymous>:822:32)
    at ReactCompositeComponentWrapper.performInitialMount (eval at ./node_modules/react-dom/lib/ReactCompositeComponent.js (http://localhost:3000/script.js?8f8500a7:4553:1), <anonymous>:362:30)
    at ReactCompositeComponentWrapper.mountComponent (eval at ./node_modules/react-dom/lib/ReactCompositeComponent.js (http://localhost:3000/script.js?8f8500a7:4553:1), <anonymous>:258:21)
    at Object.mountComponent (eval at ./node_modules/react-dom/lib/ReactReconciler.js (http://localhost:3000/script.js?8f8500a7:4897:1), <anonymous>:46:35)
    at ReactCompositeComponentWrapper.performInitialMount (eval at ./node_modules/react-dom/lib/ReactCompositeComponent.js (http://localhost:3000/script.js?8f8500a7:4553:1), <anonymous>:371:34)



cheap-source-map
ReferenceError: lol is not defined
    at App.render (http://localhost:3000/script.js?44ca0292:51464:7)
    at App.render (http://localhost:3000/script.js?44ca0292:41164:30)
    at http://localhost:3000/script.js?44ca0292:28976:21
    at measureLifeCyclePerf (http://localhost:3000/script.js?44ca0292:28255:12)
    at ReactCompositeComponentWrapper._renderValidatedComponentWithoutOwnerOrContext (http://localhost:3000/script.js?44ca0292:28975:25)
    at ReactCompositeComponentWrapper._renderValidatedComponent (http://localhost:3000/script.js?44ca0292:29002:32)
    at ReactCompositeComponentWrapper.performInitialMount (http://localhost:3000/script.js?44ca0292:28542:30)
    at ReactCompositeComponentWrapper.mountComponent (http://localhost:3000/script.js?44ca0292:28438:21)
    at Object.mountComponent (http://localhost:3000/script.js?44ca0292:35020:35)
    at ReactCompositeComponentWrapper.performInitialMount (http://localhost:3000/script.js?44ca0292:28551:34)



cheap-module-eval-source-map
ReferenceError: lol is not defined
    at App.render (eval at ./src/App.js (http://localhost:3000/script.js?8f8500a7:6210:1), <anonymous>:92:7)
    at App.render (eval at ./node_modules/react-proxy/modules/createPrototypeProxy.js (http://localhost:3000/script.js?8f8500a7:5431:1), <anonymous>:44:30)
    at eval (eval at ./node_modules/react-dom/lib/ReactCompositeComponent.js (http://localhost:3000/script.js?8f8500a7:4553:1), <anonymous>:796:21)
    at measureLifeCyclePerf (eval at ./node_modules/react-dom/lib/ReactCompositeComponent.js (http://localhost:3000/script.js?8f8500a7:4553:1), <anonymous>:75:12)
    at ReactCompositeComponentWrapper._renderValidatedComponentWithoutOwnerOrContext (eval at ./node_modules/react-dom/lib/ReactCompositeComponent.js (http://localhost:3000/script.js?8f8500a7:4553:1), <anonymous>:795:25)
    at ReactCompositeComponentWrapper._renderValidatedComponent (eval at ./node_modules/react-dom/lib/ReactCompositeComponent.js (http://localhost:3000/script.js?8f8500a7:4553:1), <anonymous>:822:32)
    at ReactCompositeComponentWrapper.performInitialMount (eval at ./node_modules/react-dom/lib/ReactCompositeComponent.js (http://localhost:3000/script.js?8f8500a7:4553:1), <anonymous>:362:30)
    at ReactCompositeComponentWrapper.mountComponent (eval at ./node_modules/react-dom/lib/ReactCompositeComponent.js (http://localhost:3000/script.js?8f8500a7:4553:1), <anonymous>:258:21)
    at Object.mountComponent (eval at ./node_modules/react-dom/lib/ReactReconciler.js (http://localhost:3000/script.js?8f8500a7:4897:1), <anonymous>:46:35)
    at ReactCompositeComponentWrapper.performInitialMount (eval at ./node_modules/react-dom/lib/ReactCompositeComponent.js (http://localhost:3000/script.js?8f8500a7:4553:1), <anonymous>:371:34)



cheap-module-source-map
ReferenceError: lol is not defined
    at App.render (http://localhost:3000/script.js?44ca0292:51464:7)
    at App.render (http://localhost:3000/script.js?44ca0292:41164:30)
    at http://localhost:3000/script.js?44ca0292:28976:21
    at measureLifeCyclePerf (http://localhost:3000/script.js?44ca0292:28255:12)
    at ReactCompositeComponentWrapper._renderValidatedComponentWithoutOwnerOrContext (http://localhost:3000/script.js?44ca0292:28975:25)
    at ReactCompositeComponentWrapper._renderValidatedComponent (http://localhost:3000/script.js?44ca0292:29002:32)
    at ReactCompositeComponentWrapper.performInitialMount (http://localhost:3000/script.js?44ca0292:28542:30)
    at ReactCompositeComponentWrapper.mountComponent (http://localhost:3000/script.js?44ca0292:28438:21)
    at Object.mountComponent (http://localhost:3000/script.js?44ca0292:35020:35)
    at ReactCompositeComponentWrapper.performInitialMount (http://localhost:3000/script.js?44ca0292:28551:34)



eval-source-map
ReferenceError: lol is not defined
    at App.render (eval at ./src/App.js (http://localhost:3000/script.js?94eeab35:6210:1), <anonymous>:92:7)
    at App.render (eval at ./node_modules/react-proxy/modules/createPrototypeProxy.js (http://localhost:3000/script.js?94eeab35:5431:1), <anonymous>:44:30)
    at eval (eval at ./node_modules/react-dom/lib/ReactCompositeComponent.js (http://localhost:3000/script.js?94eeab35:4553:1), <anonymous>:796:21)
    at measureLifeCyclePerf (eval at ./node_modules/react-dom/lib/ReactCompositeComponent.js (http://localhost:3000/script.js?94eeab35:4553:1), <anonymous>:75:12)
    at ReactCompositeComponentWrapper._renderValidatedComponentWithoutOwnerOrContext (eval at ./node_modules/react-dom/lib/ReactCompositeComponent.js (http://localhost:3000/script.js?94eeab35:4553:1), <anonymous>:795:25)
    at ReactCompositeComponentWrapper._renderValidatedComponent (eval at ./node_modules/react-dom/lib/ReactCompositeComponent.js (http://localhost:3000/script.js?94eeab35:4553:1), <anonymous>:822:32)
    at ReactCompositeComponentWrapper.performInitialMount (eval at ./node_modules/react-dom/lib/ReactCompositeComponent.js (http://localhost:3000/script.js?94eeab35:4553:1), <anonymous>:362:30)
    at ReactCompositeComponentWrapper.mountComponent (eval at ./node_modules/react-dom/lib/ReactCompositeComponent.js (http://localhost:3000/script.js?94eeab35:4553:1), <anonymous>:258:21)
    at Object.mountComponent (eval at ./node_modules/react-dom/lib/ReactReconciler.js (http://localhost:3000/script.js?94eeab35:4897:1), <anonymous>:46:35)
    at ReactCompositeComponentWrapper.performInitialMount (eval at ./node_modules/react-dom/lib/ReactCompositeComponent.js (http://localhost:3000/script.js?94eeab35:4553:1), <anonymous>:371:34)



eval-source-map
ReferenceError: lol is not defined
    at App.render (http://localhost:3000/script.js?80015be0:51465:7)
    at App.render (http://localhost:3000/script.js?80015be0:41165:30)
    at http://localhost:3000/script.js?80015be0:28977:21
    at measureLifeCyclePerf (http://localhost:3000/script.js?80015be0:28256:12)
    at ReactCompositeComponentWrapper._renderValidatedComponentWithoutOwnerOrContext (http://localhost:3000/script.js?80015be0:28976:25)
    at ReactCompositeComponentWrapper._renderValidatedComponent (http://localhost:3000/script.js?80015be0:29003:32)
    at ReactCompositeComponentWrapper.performInitialMount (http://localhost:3000/script.js?80015be0:28543:30)
    at ReactCompositeComponentWrapper.mountComponent (http://localhost:3000/script.js?80015be0:28439:21)
    at Object.mountComponent (http://localhost:3000/script.js?80015be0:35021:35)
    at ReactCompositeComponentWrapper.performInitialMount (http://localhost:3000/script.js?80015be0:28552:34)



source-map
ReferenceError: lol is not defined
    at App.render (http://localhost:3000/script.js?4bb02e5d:51469:7)
    at App.render (http://localhost:3000/script.js?4bb02e5d:41169:30)
    at http://localhost:3000/script.js?4bb02e5d:28981:21
    at measureLifeCyclePerf (http://localhost:3000/script.js?4bb02e5d:28260:12)
    at ReactCompositeComponentWrapper._renderValidatedComponentWithoutOwnerOrContext (http://localhost:3000/script.js?4bb02e5d:28980:25)
    at ReactCompositeComponentWrapper._renderValidatedComponent (http://localhost:3000/script.js?4bb02e5d:29007:32)
    at ReactCompositeComponentWrapper.performInitialMount (http://localhost:3000/script.js?4bb02e5d:28547:30)
    at ReactCompositeComponentWrapper.mountComponent (http://localhost:3000/script.js?4bb02e5d:28443:21)
    at Object.mountComponent (http://localhost:3000/script.js?4bb02e5d:35025:35)
    at ReactCompositeComponentWrapper.performInitialMount (http://localhost:3000/script.js?4bb02e5d:28556:34)

@frux

frux commented May 29, 2017 •

Copy link
Copy Markdown

@borela It's so cool, man! About the only issue: as much as I know it's impossible to open sources by clicking these links at least because webpack doesn't serve source files.

@davidpfahler

Copy link
Copy Markdown
Member

@borela Thanks for your pull request! Could you please fix the build before we discuss what the possible up and downsides are?

@borela borela changed the title Load the source map before displaying the error [Not Ready] Load the source map before displaying the error May 30, 2017
@borela

borela commented May 30, 2017 •

Copy link
Copy Markdown
Contributor Author

@frux I was hoping there was a way but it's ok, it is showing the correct lines at least.

@davidpfahler I fixed the tests but this pull still needs some changes. I'll update it soon to fix evals too.

@davidpfahler

Copy link
Copy Markdown
Member

@borela Thanks! I will see it if you ping me here.

@borela borela changed the title [Not Ready] Load the source map before displaying the error Load the source map before displaying the error May 30, 2017
@borela

borela commented May 30, 2017

Copy link
Copy Markdown
Contributor Author

@davidpfahler Hi David, I added special cases for eval source maps and tested on a local repo. All the available settings for devtool in webpack are working, but of course the precision will depend on the method chosen.

@davidpfahler

Copy link
Copy Markdown
Member

Thanks @borela. I renamed the commits and rebased onto master.

@borela

borela commented May 30, 2017

Copy link
Copy Markdown
Contributor Author

Thank you David, please let me know when the package gets published so that I can remove the symbolic links from my projects.

@davidpfahler

Copy link
Copy Markdown
Member

@borela Sorry for the delay. This was my mistake. Changes have just been published as v1.3.7.

@borela

borela commented May 31, 2017 •

Copy link
Copy Markdown
Contributor Author

@davidpfahler Thank you!

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

Successfully merging this pull request may close these issues.

3 participants