Skip to content
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 build with webpack 3.10 #51

Closed
kopax opened this issue Dec 7, 2017 · 2 comments
Closed

Can't build with webpack 3.10 #51

kopax opened this issue Dec 7, 2017 · 2 comments

Comments

@kopax
Copy link

kopax commented Dec 7, 2017

Hi @chromakode , I have installed and tested your library.
The HTML email I receive is working. Thanks a lot for sharing your work.

I am trying to build for production with webpack and It seems that you are not transpiling your module to es2015 module.

ERROR in main.43150ac1b07aa1b9d40e.js from UglifyJs
Unexpected token: punc (() [main.43150ac1b07aa1b9d40e.js:171807,7]

That looks like to be a problem : https://github.com/chromakode/react-html-email/blob/master/.babelrc#L5

I have made and published this version that correct the plugin for browsers:

version

  • node 9.2.0
  • npm 5.6.0
@dpetrini
Copy link

dpetrini commented Dec 14, 2017

Hello,

I have same issue:

ERROR in bundle.js from UglifyJs
Unexpected token: punc (() [./node_modules/react-html-email/lib/PropTypes.js:26,0][bundle.js:10137,7]

My versions:

"webpack": "^3.6.0",
"react": "^15.6.1",
"react-dom": "^15.6.1",
"react-html-email": "^3.0.0",

$ node --version
v6.9.4

Ok for development, issue happens in webpack build.

Thanks

@kopax
Copy link
Author

kopax commented Dec 14, 2017

@dpetrini I have found the reason of that issue, @chromakode did make that module for NodeJS.

For that, you need to check the babel target here :

https://github.com/chromakode/react-html-email/blob/master/.babelrc#L5

I have made a browser compatible version of the 3.0.0 of react-html-mail :

https://www.npmjs.com/package/react-html-email-browser

All I did was to change the target.

@kopax kopax closed this as completed Dec 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants