Skip to content

Update tracekit.js to include webpack stacktrace #903

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

Closed
wants to merge 2 commits into from
Closed

Update tracekit.js to include webpack stacktrace #903

wants to merge 2 commits into from

Conversation

RahavLussato
Copy link
Contributor

No description provided.

Copy link
Contributor

@benvinegar benvinegar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know what this is solving. Do you have an example?

We also don't accept parsing changes without tests.

gecko = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|resource|\[native).*?)(?::(\d+))?(?::(\d+))?\s*$/i,
winjs = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,
var chrome = /^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,
gecko = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpac|resource|\[native).*?)(?::(\d+))?(?::(\d+))?\s*$/i,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

webpac?

Copy link
Contributor Author

@RahavLussato RahavLussato Mar 25, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i fixed it, its should be webpack

@RahavLussato
Copy link
Contributor Author

RahavLussato commented Mar 25, 2017

hi @benvinegar i took this change from here: https://github.com/csnover/TraceKit/blob/master/tracekit.js

it solve situation when you work with webpack with devtool: 'eval' mostly on staging, the code that generated starts with "webpack" and the current regex don't match it and i don't have stack trace because of that.

@benvinegar
Copy link
Contributor

Right – I see the PR here. Alas, I still need a test, or at least a sample stack trace that the environment you're describing generates.

@RahavLussato
Copy link
Contributor Author

RahavLussato commented Mar 25, 2017

@benvinegar sample: webpack:///./~/react-dom/lib/ or webpack:///./src/components/ it just will always start with wbpack://, basically i don't get why to keep local copy of traceKit instead of using the repo as dependency or using your own fork, but if you want to keep it you should manage it and update that to have the latest changes.

@RahavLussato
Copy link
Contributor Author

here is complete stack trace sample:

TypeError: Cannot read property 'error' of undefined
  at TESTTESTTEST.eval(webpack:///./src/components/test/test.jsx?:295:108)
  at TESTTESTTEST.render(webpack:///./src/components/test/test.jsx?:272:32)
  at TESTTESTTEST.tryRender(webpack:///./~/react-transform-catch-errors/lib/index.js?:34:31)
  at TESTTESTTEST.proxiedMethod(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._updateRenderedComponent(webpack:///./~/react-dom/lib/ReactCompositeComponent.js?:746:36)
  at ReactCompositeComponentWrapper._performComponentUpdate(webpack:///./~/react-dom/lib/ReactCompositeComponent.js?:724:10)
  at ReactCompositeComponentWrapper.updateComponent(webpack:///./~/react-dom/lib/ReactCompositeComponent.js?:645:12)
  at ReactCompositeComponentWrapper.performUpdateIfNecessary(webpack:///./~/react-dom/lib/ReactCompositeComponent.js?:561:12)
  at Object.performUpdateIfNecessary(webpack:///./~/react-dom/lib/ReactReconciler.js?:157:22)
  at runBatchedUpdates(webpack:///./~/react-dom/lib/ReactUpdates.js?:150:21)
  at ReactReconcileTransaction.perform(webpack:///./~/react-dom/lib/Transaction.js?:140:20)
  at ReactUpdatesFlushTransaction.perform(webpack:///./~/react-dom/lib/Transaction.js?:140:20)
  at ReactUpdatesFlushTransaction.perform(webpack:///./~/react-dom/lib/ReactUpdates.js?:89:32)
  at Object.flushBatchedUpdates(webpack:///./~/react-dom/lib/ReactUpdates.js?:172:19)
  at ReactDefaultBatchingStrategyTransaction.closeAll(webpack:///./~/react-dom/lib/Transaction.js?:206:25)
  at ReactDefaultBatchingStrategyTransaction.perform(webpack:///./~/react-dom/lib/Transaction.js?:153:16)
  at Object.batchedUpdates(webpack:///./~/react-dom/lib/ReactDefaultBatchingStrategy.js?:62:26)
  at Object.enqueueUpdate(webpack:///./~/react-dom/lib/ReactUpdates.js?:200:22)
  at enqueueUpdate(webpack:///./~/react-dom/lib/ReactUpdateQueue.js?:24:16)
  at Object.enqueueForceUpdate(webpack:///./~/react-dom/lib/ReactUpdateQueue.js?:157:5)
  at TESTTESTTEST.ReactComponent.forceUpdate(webpack:///./~/react/lib/ReactComponent.js?:84:16)
  at forceUpdateIfPending(webpack:///./~/react-deep-force-update/lib/index.js?:28:43)
  at traverseRenderedChildren(webpack:///./~/react-deep-force-update/lib/index.js?:6:3)
  at eval(webpack:///./~/react-deep-force-update/lib/index.js?:36:5)
  at eval(webpack:///./~/react-transform-hmr/lib/index.js?:84:28)
  at wrapped(webpack:///./~/raven-js/src/raven.js?:295:29)

@benvinegar
Copy link
Contributor

benvinegar commented Mar 25, 2017

basically i don't get why to keep local copy of traceKit instead of using the repo as dependency or using your own fork, but if you want to keep it you should manage it and update that to have the latest changes.

You're welcome to read through the history to see what's changed to the file in order to understand. The TL;DR is that our version is wildly forked, and contains less than half of TraceKit's original code. We literally cannot use the upstream repository at this point.

here is complete stack trace sample:

Thanks.

@benvinegar
Copy link
Contributor

Moved to #908 where I've added tests (but retains your original commit)

@benvinegar benvinegar closed this Mar 26, 2017
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.

2 participants