Uh oh!
There was an error while loading. Please reload this page.
Don't strip stack traces of evaluated webpack bundles - #1050
Conversation
facebook-github-bot
commented
Nov 17, 2016
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks! If you are contributing on behalf of someone else (eg your employer): the individual CLA is not sufficient - use https://developers.facebook.com/opensource/cla?type=company instead. Contact cla@fb.com if you have any questions. |
facebook-github-bot
commented
Nov 17, 2016
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
because the last line doesn't always have a `\n` and `create-react-app` is leaving the last line of the stack traces present in the error messages
jameslnewell
commented
Nov 17, 2016
Also fixed an issue where the last line of the stack trace is left in the message because it doesn't end with |
gaearon
commented
Nov 17, 2016
Can you add a comment explaining the exception to future readers? |
jameslnewell
commented
Nov 21, 2016
Sure. How's that look? |
gaearon
commented
Dec 5, 2016
Looks great. |
* master: (30 commits) Relax peerDependencies for ESLint preset (react#1191) Update Webpack to fix source map issues (react#1188) Update webpack prod config (react#1181) Chrome 'open tab' reuse an empty tab when possible (react#1165) Use file-loader for svgs (react#1180) Fix Babel issues in tests by applying the right transforms (react#1179) [babel-preset-react-app] Temporary fix missing babel plugins (react#1177) Add Subresource Integrity support (react#1176) Remove path module from webpack config on eject. (react#1175) Don't strip stack traces of evaluated webpack bundles (react#1050) Add deploy to Firebase CDN on template's README (Closesreact#374) (react#1143) Update e2e.sh (react#1167) Document what npm build does and pushState (react#933) Fix minor typo/grammar (react#1099) Add "npm run build silently fails" to Troubleshooting (react#1168) Add testURL to jest config (react#1120) Make jsx-no-undef rule an error (react#1159) Update CHANGELOG.md Publish Update changelog for 0.8.1 ...
* Don't strip stack traces of evaluated webpack code * Strip stack traces at the end of a string because the last line doesn't always have a `\n` and `create-react-app` is leaving the last line of the stack traces present in the error messages * code comment * code comment
* Don't strip stack traces of evaluated webpack code * Strip stack traces at the end of a string because the last line doesn't always have a `\n` and `create-react-app` is leaving the last line of the stack traces present in the error messages * code comment * code comment
formatWebpackMessagesis neat! I'm using it outside ofcreate-react-app. However, it's a little too eager in stripping stack traces from messages.I'm using the static-react-render-webpack-plugin which evaluates the outputted webpack bundle. When evaluating the outputted webpack bundle throws (in the user's code), the user needs the stack trace to debug what went wrong.
formatWebpackMessagesis stripping all stack traces making that difficult.This PR excludes stack traces where the source path contains
webpack:. I've created a demo of the regexp working which shows stack traces being stripped forbabel-loaderbut notstatic-react-render-webpack-plugin.Example stack trace