-
Notifications
You must be signed in to change notification settings - Fork 47.4k
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
Can't contribute to React on Windows #9540
Comments
Yes, the build is likely broken on Windows right now. Can you look into where it breaks? We should file more issues with Rollup if it’s their bug. |
Thanks for you reply.I try to all the solutions in the issues and the pr(involve not merged) of |
@gaearon Hi dan,is there any progress on this? |
No, we’re not using Windows, and would like to get community help on this. |
get it,so I will ask for help in other place,close now,if I find a solution,I will share and reopen |
I'd like to keep it open to keep track of this being broken. |
I was getting the same error as @NE-SmallTown above. Tried fixing it, and made progress, but didn't fix it fully. The below are obviously workarounds rather than real fixes, but anyway... Error 1)
Solution: Do a "replace all in files":
Error 2)
Solution: Do a "replace all in files":
Error 3)
Solution: Make change in -var ReactInternals = require("react")
+var ReactInternals = require("[react root]/src/isomorphic/React.js") This lets the build process get farther:
However, as can be seen, I'm now getting a Anyway, maybe someone else can figure out the next step. (us poor Windows people, deserted by the Linux and Mac devs... 😭) |
@Venryx Thanks for your attempt. You say:
I don't find it,is there any typo? |
Build on windows issue has two parts: First part [rollup-plugin-alias]:related issue #9350
Second part [windows path in replaced require string]:replace modules // for use with rollup repalce plugin:
// windows paths breaks the string if we dosn't replace all "\" with "/"
function normalizeReplaceModules(mapToReplace) {
const newMap = {};
Object.keys(mapToReplace).forEach(key => {
newMap[key] = mapToReplace[key].replace(/\\/g, '/');
});
return newMap;
}
// .... and then in getPlugins()
const replaceModules = Modules.getDefaultReplaceModules(bundleType);
if (Object.keys(replaceModules).length > 0) {
// normalizeReplaceModules only make effect on windows paths it replace "\" with "/"
plugins.unshift(replace(normalizeReplaceModules(replaceModules))); // <----- here
} @Venryx @NE-SmallTown @teemosauce @ccsang please confirm this solve the issue |
@mhhegazy Greate work!Thanks a lot!!!Really much appreciated! 👍 |
@mhhegazy BTW,I execute the commands follow the fiber-debugger doc,but get error
I think this is because the loader can't find the corresponding modules,but if I press |
@NE-SmallTown it work as desired on my environment. but this not related to this issue if your build end with all Diffs is 0% in this table then the build succeed. |
@NE-SmallTown where you run commands (CMD, PowerShell, bash or WebStorm Run) $ set NODE_PATH=../../build/packages then $ npm start and if you run it from WebStorm take a look here |
@mhhegazy It works for me.Thanks a lot! 😃 |
What's the next steps here? Any PRs we should merge? |
Get Outlook for iOS<https://aka.ms/o0ukef>
…________________________________
From: Mohamed H. Hegazy <[email protected]>
Sent: Friday, September 29, 2017 11:02:11 PM
To: facebook/react
Cc: Subscribed
Subject: Re: [facebook/react] Can't build React on Windows (#9540)
@gaearon<https://github.com/gaearon> I've created PR #10982<#10982> please review it
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<#9540 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AcTxbk0OKT34PX8HWtz6hMeKbKmQEo7Wks5sna8zgaJpZM4NJyig>.
|
Let's make sure we also fix:
and really anything that's broken now. |
@gaearon
[screenshots: left is Windows and right is Ubuntu] $ yarn linc windows doesn't have grep command $ yarn prettier-all issue #9500 (a too long command) and PR #9523 here is the output of rest:$ yarn build fixed in PR #10982 $ yarn lint $ yarn test $ yarn flow $ yarn prettier |
I verified I don't care strongly about |
OK. Hopefully this shouldn't become an issue in the future as we now run the build and tests on CI. |
Do you want to request a feature or report a bug?
I am not sure,maybe it's just a question.
What is the current behavior?
I fork the lasted master branch of react,and execute
npm run build
at the root directory.But get some errors below:If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar (template: https://jsfiddle.net/84v837e9/).
What is the expected behavior?
Build successfully.
Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
16.0.0-alpha.11 .Windows.I am not sure whether it is fine in previous versions of React,this is my first build
The text was updated successfully, but these errors were encountered: