butternut-webpack-plugin
butternut-webpack-plugin copied to clipboard
Cannot read property minify of null
Hey! Thanks for the lib.
I might be totally missing something, but when I installed from npm all I got was the README.md
and the package.json
. It could be because npm inherits the .gitignore
config if it's available, so a blank .npmignore
should override it, in my experience.
Happy to make a PR, but figured that you'd want to determine what else npm ignores and it's tiny tiny change 😛
UPDATE: I had manually compiled this lib locally and ran into errors, a la:
NODE_ENV=production webpack --config webpack.production.config.js -p
/Users/eric.bailey/Sites/quanta-server/node_modules/butternut-webpack-plugin/node_modules/butternut/dist/butternut.cjs.js:1662
this.alternate.minify( code );
I just needed to remov the -p
flag from the webpack command. My bad! Updating here in case it helps someone else.
Arrrrgh totally my bad, can you install the 0.0.6
version?
Sweet, thanks!
The same error is happening here and I'm using version 0.0.6
😢
Hey pedronauck! Don't cry! :smile:
Can you check the content of the package installed? The version in the module package.json
is 0.0.6
? Checking the unpkg returns me the correct index.js
Yes, it's the same file, and that's the error
/Users/pedronauck/Projects/personal/projects/shazam/node_modules/butternut/dist/butternut.cjs.js:1662
this.alternate.minify( code );
^
TypeError: Cannot read property 'minify' of null
I'm using Webpack 2!
I think this is an issue with butternut itself rather than the module then, a similar issue has been reported in #123, as @estrattonbailey said, you need to remove the -p
option.
Hi. I had the same error:
Cannot read property 'minify' of null
The option that cause it is:
'process.env.NODE_ENV': JSON.stringify('production')
Yup, agree with @gombek. It's breaking when NODE_ENV
is "production"
. If I just change what the DefinePlugin's value for process.env.NODE_ENV
equals, it doesn't break anything, but if NODE_ENV
is actually set to "production"
, this error shows up.
Note: I'm currently minifying for both dev and prod, so it's not a simple mistake of not running Butternut in dev.
Reopening for visibility, it's quite annoying that setting the production env does this, since butternut is intended to be run only with this one
Hmm, just run into this, but it looks like relevant issue https://github.com/Rich-Harris/butternut/issues/137 might be already fixed on master, but this plugin depends on "butternut": "^0.3.5"
so versions 0.4.* (including latest 0.4.6) are not installed.
@Apercu Could you bump the dependency or maybe even make it peerDependency
and let people install preferred version of babili
on their own?
Bumped all deps in 0.1.0
, let me know.