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

Cannot deploy with Webpack - Unexpected token in #5

Closed
GitHubGreg opened this issue May 18, 2019 · 7 comments · Fixed by #6
Closed

Cannot deploy with Webpack - Unexpected token in #5

GitHubGreg opened this issue May 18, 2019 · 7 comments · Fixed by #6
Labels

Comments

@GitHubGreg
Copy link

After installing this package and trying to deploy my project, I now get this error:

ERROR in assets/js/index.e28b.js from UglifyJs
Unexpected token: keyword (const) [./node_modules/redux-form-normalize-on-blur/es/index.js:20,0][assets/js/index.e28b.js:5843,0]

Thanks in advance for any help.

@jedwards1211
Copy link
Member

Ah use a webpack rule to transpile this package

@GitHubGreg
Copy link
Author

Could you elaborate on that please?

@GitHubGreg
Copy link
Author

Have been trying to resolve this for about an hour with no luck. Babel 7+ excludes node_modules by default, and including a single package throws errors (lots of forum posts about similar issues but no solution that has worked so far). Any chance you'd consider updating this package to be already transpiled?

@GitHubGreg
Copy link
Author

For anyone else having this issue, I resolved it by switching from uglify to terser, as per this suggestion.

Since this is for redux-form, perhaps consider writing this package with the same ecma standards as the redux-form package.

@jedwards1211
Copy link
Member

Yeah i think I will get rid of the half-transpiled code when I get a chance. I had added that to a bunch of my packages for the sake of making builds for modern browsers smaller, but I think it's just too much trouble for people. Terser probably works because it understands ES6. But the output code would probably still not work in old browsers. Sorry this has caused you grief, when I get back to my computer I'll switch it to full transpiling.

@GitHubGreg
Copy link
Author

Great thanks, I appreciate this helpful package.

@jedwards1211
Copy link
Member

🎉 This issue has been resolved in version 1.0.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants