-
Notifications
You must be signed in to change notification settings - Fork 150
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
Failed to compile - UglifyJs returns undefined #341
Comments
Hi Guillaume! We have |
Hi halfzebra ! Ok so I thought it was related to the Custom Element I use but after looking into it again, I realized that I need the polyfill to use a library that uses ES6. I thought it was easier to import the babel polyfill than ejecting Any idea if there is a clean solution to use that ES6 library ? Thanks again ! |
Hi Guillaume, I'm having exactly the same issue, did you solve the problem? |
Hi Jonsey ! No... I didn't find a clean solution =/ I'm looking back at my commits and apparently, I just downgraded the lib to a version that was not depending on ES6... I'm very keen to hear about your solution if you find one :) Good luck ! |
I did a clean elm-app create and only added
this gave me ReferenceError: regeneratorRuntime is not defined when running elm-app build |
OK, I fixed it, sort of. I'm not sure why the existing set up with @babel/runtime-generator isn't working, but I removed @babel/polyfil from my index.js and added require('regenerator-runtime/runtime'); I know it pollutes the global namespace but I can now compile in debug and production mode |
Well done @Jonsey ! That is a way better workaround than downgrading the libs ! And I tip my hat to you @halfzebra for the quick PR :) |
🎉 This issue has been resolved in version 3.0.6 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Is this a bug report?
yes
Environment
node -v
: v10.15.0npm -v
: 6.4.1yarn --version
(if you use Yarn): 1.12.3npm ls create-elm-app -g
(if you haven’t ejected):Then, specify:
Steps to Reproduce
I import "@babel/polyfill" and then I get:
If I use
elm-app start
, no problemIf I comment the babel polyfill, it compiles just fine
If I comment the whole Uglify config in the create-elm-app
webpack.config.prog.js
, it works well.My guess would be that I should avoid mixing up the babel polyfill with Uglify but I'm not sure how to do that. I used the exclude option (
exclude: '@babel/polyfill'
) of Uglify inwebpack.config.prog.js
but no success. I guess it's already included in the chunk and therefore processed by the Uglify plugin.It feels like there's a simple solution but I don't understand the process very well. I'm not even sure why it breaks with
ReferenceError: regeneratorRuntime is not defined
if I dont use the babel polyfill. From the stack trace it seems to come fromcustomElements.define
.Edit I just saw
@babel/plugin-transform-runtime
in the webpack config... so why would I get theregeneratorRuntime
error then !?I'll keep investigating but in the meantime, I thought someone could have some useful info to share :)
Let me know what else could be useful !
Thanks for your really helpful work !
Guillaume
The text was updated successfully, but these errors were encountered: