Closed MarttiR closed 6 years ago
Hey @MarttiR!
Looking at that, it seems your build is grabbing src/utils.js
which is the uncompiled source instead of "main"
as specified in package.json which is index.js
. There could be something wrong in redux-bundler too, but if you require stuff from index.js it should all be es5.
Feel free to re-open if this is still an issue, but I'll close this for now.
Now that I had some more time to dig around: it seems that the reason for this error is that the module
keyword in package.json should point to an ES6 module, but it should not contain any ES6 code.
So yeah, this is still an issue.
See https://github.com/facebook/create-react-app/issues/3889 for more.
Cool, makes sense.
@MarttiR thanks again. I've published a new version 17.0.1
that should fix this for you.
It's now built using microbundle and the module
field now points to a compiled version in /dist
instead of the main (uncompiled) entry point. This should resolve things, hopefully. Thanks again and please let me know if it doesn't. Cheers!
Thanks a lot for this! I've used redux-bundler for the past few weeks and the developer experience has been fantastic compared to plain redux.
It's awesome. You're awesome. Thank you.
Possibly related, Bundler gives me the redux 'minified' warning in development - You are currently using minified code outside of NODE_ENV === 'production'.
And it is in fact giving me minified console errors. Any ideas?
@greggb what you're seeing is a separate issue from what these folks were talking about. It's due to the fact that microbundle
which we use to compile redux-bundler minifies code by default, we need to change it to build without minification, this error is rather annoying (I'll open a ticket for this).
@greggb if you install latest 21.0.1
you should no longer see the warning
Sorry for the mis-categorization @HenrikJoreteg - wanted to avoid opening a new issue if something already existed. That did the trick! Thanks very much for looking into it. Having a blast moving from sagas to bundler (especially now that I can see the actual errors 😄).
@greggb sweet! Glad you're enjoying it :) Don't hesitate to file issues and send PRs though, if you have any trouble.
The npm package should be compiled to ES5, because ES6 dependencies are not supported by create-react-app: