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 read property minify of null #4

Open
estrattonbailey opened this issue May 16, 2017 · 11 comments
Open

Cannot read property minify of null #4

estrattonbailey opened this issue May 16, 2017 · 11 comments
Labels

Comments

@estrattonbailey
Copy link

estrattonbailey commented May 16, 2017

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.

@balthazar balthazar added the bug label May 16, 2017
@balthazar
Copy link
Owner

Arrrrgh totally my bad, can you install the 0.0.6 version?

@estrattonbailey
Copy link
Author

Sweet, thanks!

@pedronauck
Copy link

The same error is happening here and I'm using version 0.0.6 😢

@balthazar
Copy link
Owner

Hey pedronauck! Don't cry! 😄
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

@pedronauck
Copy link

pedronauck commented May 31, 2017

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!

@balthazar
Copy link
Owner

balthazar commented May 31, 2017

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.

@balthazar balthazar changed the title Compiled file not available via NPM Cannot read property minify of null May 31, 2017
@gombek
Copy link

gombek commented Jun 1, 2017

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')

@joezimjs
Copy link

joezimjs commented Jun 1, 2017

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.

@balthazar balthazar reopened this Jun 1, 2017
@balthazar
Copy link
Owner

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

@RReverser
Copy link

Hmm, just run into this, but it looks like relevant issue Rich-Harris/butternut#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?

@balthazar
Copy link
Owner

Bumped all deps in 0.1.0, let me know.

Repository owner deleted a comment from RReverser Jun 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants