Open gpspake opened 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.
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?
same errors, I am on windows
About the error #65, it happens also on Mac
I have posted a fix for the require.ensure
issue here https://github.com/btholt/complete-intro-to-react/issues/65
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 preventSyntaxError: Unexpected token import
and build.Environment:
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
NODE_ENV not recognized
Fix update dev script in to package.json to:"dev": "SET NODE_ENV=development && nodemon server.js",
yarn dev
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: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.