Skip to content
This repository has been archived by the owner on Sep 10, 2022. It is now read-only.

Production build is broken #55

Closed
billyjanitsch opened this issue Nov 13, 2015 · 3 comments
Closed

Production build is broken #55

billyjanitsch opened this issue Nov 13, 2015 · 3 comments

Comments

@billyjanitsch
Copy link
Contributor

In production, createHelper is set to lodash's curry here, which has signature:
curry(func, arity).

In development, it uses a custom implementation here with signature:
curry(func, helperName, arity, setDisplayName)

Note the different arity argument position.

createHelper is used to create setStatic here with the arity as the 3rd argument. This works fine in development, but in production, Lodash returns the function without actually implement currying.

setStatic, expecting to be curried, is called with a single argument here. This works fine in development but throws in production because it tries to access a key on an undefined variable.

This all happens during library setup, so even just including recompose in production throws the cryptic error: Uncaught TypeError: Cannot set property 'propTypes' of undefined.

@mrblueblue
Copy link
Contributor

I received this error in a production environment as well.

I was using my own curried setProptypes and setDisplayname functions (not knowing they were part of the library), and when I switched to thr library functions I saw the same errors.

Again, as billyjanitsch points out--all is well in dev.

@acdlite
Copy link
Owner

acdlite commented Nov 13, 2015

Sorry about that! Should be fixed in 0.9.2. The tests aren't set up to run in both development and production (yet), which is why I didn't catch this.

@billyjanitsch
Copy link
Contributor Author

Thanks for the quick fix! 👍

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

No branches or pull requests

3 participants