Uh oh!
There was an error while loading. Please reload this page.
Switch to unix path separators before normalizing path for Windows compatibility - #3079
Conversation
Timer
commented
Sep 6, 2017
Hmm, @gaearon -- isn't the "Check your code at" part a little redundant? |
gaearon
commented
Sep 6, 2017
Redundant in what way? |
| let { fileName } = frame; | ||
| if (fileName) { | ||
| fileName = path.normalize(fileName); | ||
| fileName = path.normalize(fileName.replace(/[\\]+/g, '/')); |
There was a problem hiding this comment.
Would be nice to add a comment for why it helps.
Timer
commented
Sep 6, 2017
Just that we're displaying the code with contextual highlighting, but still telling the user to check the code at that location. |
gaearon
commented
Sep 6, 2017
We should probably make it consistent, but this can be fixed in React itself rather than here. |
This reverts commit 742bace.
Timer
commented
Sep 6, 2017
Hmm, wouldn't that degrade the experience for those not using |
gaearon
commented
Sep 6, 2017
Degrade how? I assume they'd still see the stack trace. Error overlay just strips it out. |
Timer
commented
Sep 6, 2017
Hmm, I suppose it wouldn't then. |
gaearon
commented
Sep 6, 2017
@Timer Do you want to cut a release for this? |
Timer
commented
Sep 7, 2017
Sure, if you'd like! |
Hmm, what's odd is that lerna wants me to update many packages: I'd assume it'd only prompt me to do Should we do a manual release of a patch version on the overlay or a whole |
…react-app * 'master' of https://github.com/facebookincubator/create-react-app: Resolved issue react#2971 (react#2989) Revert "run npm 5.4.0 in CI (react#3026)" (react#3107) Updated react-error-overlay to latest Flow (0.54.0) (react#3065) Auto-detect running editor on Linux for error overlay (react#3077) Clean target directory before compiling overlay (react#3102) Rerun prettier and pin version (react#3058) Reload the page when an error has occurred (react#3098) run npm 5.4.0 in CI (react#3026) Unmapper Windows compatibility (react#3079) Update eslint-config npm install command (react#3072) Set travis config to use 'precise' ci environment Publish Changelog for 1.0.13 Add missing slash Make error overlay filename configurable (react#3028) provide empty mock for child_process so importing libraries with it works (react#3033) Rename Overlay to ErrorOvelay (react#3051) Strip hash from chunk file name (react#3049) Fix error overlay 'Object.assign' issue in IE by including polyfills before webpack client (react#3046)
* Switch to unix path separators before normalizing path for Windows compatibility * Add comment for posterity * Revert "Add comment for posterity" This reverts commit 742bace. * Strictly add comment
* Switch to unix path separators before normalizing path for Windows compatibility * Add comment for posterity * Revert "Add comment for posterity" This reverts commit 742bace. * Strictly add comment
* Switch to unix path separators before normalizing path for Windows compatibility * Add comment for posterity * Revert "Add comment for posterity" This reverts commit 742bace. * Strictly add comment
Turns out that the
pathmodule stubbed into a web environment does not support Windows, nor contains theposix/win32variants of path (it's fixedposix, sopath.sepreturns/in a win32 environment).Effectively, what happened here is that the
fileNamewasC:\foo\barand upon normalizing, remainedC:\foo\bar(it should've switched to/, or more specifically,path.sep).This aligns the behavior with the other path normalization process as seen here: https://github.com/facebookincubator/create-react-app/blob/b17fa4123e2d098d943f4b33ae9c5c2ac311fab6/packages/react-error-overlay/src/utils/unmapper.js#L67
Fixes#3078.