btholt / btholt/complete-intro-to-react
List of Issues/Errors and fixes for Windows users (and possibly others)
- Dominant language
- JavaScript
- Stars
- 1.1k
- Forks
- 904
- PR merge metrics
- No merged PRs in 30d
Description
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:
- Windows 10
- Node v6.10.3
- Tested with Git Bash (MingW) and CMD
- Make sure your gitconfig is set to check out with the correct line endings `git config --global core.autocrlf input`
Steps to Reproduce:
`git clone git@github.com:btholt/complete-intro-to-react.git`
`cd complete-intro-to-react`
`yarn install`
`yarn dev`
- **Error**
`NODE_ENV not recognized`
**Fix**
update dev script in to package.json to:
`"dev": "SET NODE_ENV=development && nodemon server.js",`
`yarn dev`
- **Error**
`SyntaxError: Unexpected token import`
It seems like webpack isn't honoring the "dev" prefix
**Fix**
To get this working in Windows, I had to add the babel es2015 preset:
`yarn add babel-preset-es2015 --dev`
and add the preset to my .babelrc:
```
"presets": [
"react",
"es2015",
["env", {
...
```
`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.
- **Error**
In console: `TypeError: require.ensure is not a function`
**Fix**
None Yet :D (See #65)
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.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.