react-html-email fails to compile when building
I have an app built with create-react-app. When i run the build command i get this error:

Here is my package.json
{
"name": "enjoy-copenhagen",
"version": "0.1.0",
"private": true,
"dependencies": {
"axios": "^0.17.1",
"bootstrap": "4.0.0-beta.2",
"classnames": "^2.2.5",
"currency-formatter": "^1.3.1",
"draft-js": "^0.10.4",
"firebase": "^4.6.2",
"font-awesome": "^4.7.0",
"money": "^0.2.0",
"node-sass-chokidar": "0.0.3",
"npm-run-all": "^4.1.2",
"rand-token": "^0.4.0",
"react": "^16.1.1",
"react-dom": "^16.1.1",
"react-draft-wysiwyg": "^1.12.2",
"react-dropzone": "^4.2.3",
"react-html-email": "^3.0.0",
"react-redux": "^5.0.6",
"react-router-dom": "^4.2.2",
"react-router-redux": "^4.0.8",
"react-scripts": "1.0.17",
"reactstrap": "5.0.0-alpha.4",
"redux": "^3.7.2",
"redux-form": "^7.1.2",
"redux-i18n": "^1.5.10",
"redux-thunk": "^2.2.0",
"simple-line-icons": "^2.4.1",
"react-star-ratings": "^1.3.0",
"react-image-gallery": "^0.8.6"
},
"scripts": {
"build-css": "node-sass-chokidar src/ -o src/",
"watch-css": "npm run build-css && node-sass-chokidar src/ -o src/ --watch --recursive",
"start-js": "react-scripts start",
"start": "npm-run-all -p watch-css start-js",
"build-js": "react-scripts build",
"build": "npm-run-all build-css build-js",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
},
"devDependencies": {
"redux-devtools-extension": "^2.13.2"
}
}
I also attached the debug log 2018-01-14T15_07_27_354Z-debug.log
Can anyone tell me how i can fix this?
@borisyordanov The Read more here link leads to this page.
It provides some work-arounds; I hope that helps.
@newyork-anthonyng I got it working with step 3, however, i feel like this is a bug with this package and attempt to fix it should be made.
@borisyordanov this should be fixed. We just ran into issue with this in IE 11 on our app. @MelkorNemesis's pull request should be merged IMHO.
This is not the only place where build .. failes owing to syntax. There are multiple places at which it fails.. @MelkorNemesis you should incorporate that too in your PR
is the fix pushed to npm ? i still got the problem on builds.
Same here. Specifically:
SyntaxError: Unexpected token punc «(», expected punc «:» [./~/react-html-email/lib/PropTypes.js:26,0]
Still seeing this issue as well. Is there a timeline on fixing this?
Hey since this issue has not not been fixed here i finished by using a fork of this library but fixed : https://www.npmjs.com/package/react-html-email-browsers
@Meshredded I tried installing and using your package and received the following error while running my project in development.
Module not found: Can't resolve 'react-dom/lib/DOMProperty' in '.../node_modules/react-html-email-browsers/lib'.
I am going to stick to including the original package in my src folder. I am going to stick to that until I find the time to fix this.
Update: With Create-React-App 2 this should no longer be a problem since it gets compiled. I yarn added this package and moved all my references to it instead of my "in src" version.
Change the dependency: react-html-email by react-html-email-browser This solves the problem when you try to compile the project