btholt / complete-intro-to-react

A Complete Intro to React, as Given for Frontend Masters
https://frontendmasters.com/learn/react/
MIT License
1.06k stars 927 forks source link

List of Issues/Errors and fixes for Windows users (and possibly others) #71

Open gpspake opened 7 years ago

gpspake commented 7 years ago

I'm currently using Windows (ugh) which is a complete nightmare but, considering there are bound to be other folks using it, here's my experience with a fresh clone of master as well as some notes and references. I'll keep this post up to date with additional fixes and issues as they roll in.

Current status: es2015 preset must be installed and added to .babelrc to prevent SyntaxError: Unexpected token import and build.

Environment:

Steps to Reproduce:

git clone git@github.com:btholt/complete-intro-to-react.git cd complete-intro-to-react yarn install yarn dev

yarn dev

yarn dev

At this point the app builds and works correctly. A coworker was able to get this to build without the need to add that preset; I don't understand yet how that's possible. Without that preset, is it supposed to be using the "env" preset that loads the "transform-es2015-modules-commonjs" plugin? If that's the case, why wouldn't babel honor that configuration on my machine?

There's still an error here but it doesn't prevent the app from working.

Currently, I'm unable to complete a dev build in Windows from a fresh clone of master. Interested to hear whether any Windows users have gotten this to work.

gpspake commented 7 years ago

Updates: This morning I pulled down a copy of master on OSX and it built on the first try. I still get those TypeError: require.ensure is not a function errors but the app is working. It seems, based on some research, that the root cause of the html in my bundle.js is that Babel is trying to process es2015 before react and I think that's happening because of my "hacky" brute force fix to the second error above. I'm working with a couple of other folks today to see if we can get this working on Windows.

gpspake commented 7 years ago

Updates: I was able to get the app working by installing the babel-es2015 preset and adding it to my .babelrc. I shouldn't have to do this; it seems like it's because Babel isn't honoring the "env" preset defined in .babelrc. Anyone know why that would happen?

alexwebbb commented 7 years ago

same errors, I am on windows

diazweb commented 7 years ago

About the error #65, it happens also on Mac

dannypule commented 6 years ago

I have posted a fix for the require.ensure issue here https://github.com/btholt/complete-intro-to-react/issues/65