facebook / react

The library for web and native user interfaces.
https://react.dev
MIT License
228.67k stars 46.81k forks source link

Bug in 0.12 (and 0.11.2) — type.apply error: type,apply is not a function #2423

Closed roycehaynes closed 9 years ago

roycehaynes commented 9 years ago

I've reverted all my commits tonight only to learn that Reactjs stopped being awesome.

Specifically, I nuked my node_modules to get a fresh npm install and then this happened...

screen shot 2014-10-29 at 1 47 06 am

...which led me to this...

screen shot 2014-10-29 at 1 47 40 am

When I look at the type object in debugger, it has no apply function. But, if does have type.render.apply() function.

I'm not sure why this changed but it did.

My package.json looks like this

Natim commented 9 years ago

I have the same problem here with 0.12 I had to get back to 0.11.2 to get my app working again.

Natim commented 9 years ago

@roycehaynes could you please rename your bug with "Bug in 0.12 — type.apply error: type.apply is not a function"

Regards.

roycehaynes commented 9 years ago

@Natim - I swtiched to 0.11.2 and continue to have the problem.

roycehaynes commented 9 years ago

switched*

roycehaynes commented 9 years ago

@Natim - Updated the title.

Natim commented 9 years ago

@roycehaynes Thanks.

zpao commented 9 years ago

Can you include some minimal code that reproduces this error?

Natim commented 9 years ago

You can look at https://github.com/spiral-project/formbuilder

For example Le 29 oct. 2014 20:00, "Paul O’Shannessy" notifications@github.com a écrit :

Can you include some minimal code that reproduces this error?

— Reply to this email directly or view it on GitHub https://github.com/facebook/react/issues/2423#issuecomment-60984297.

zpao commented 9 years ago

Bah, I know what's happening. This is a reactify issue (filed https://github.com/andreypopp/reactify/issues/23). Details are there. Basically it's install react-tools 0.12 for you when it shouldn't.

zpao commented 9 years ago

@Natim Hmm, so you should be able to fix your issues by upgrading to reactify@0.14 (which locked the react-tools version correctly). However, I'm still not seeing the issue when cloning that repo and running npm install (using npm@2.1.4). I'm suspicious that different npm versions are installing packages in different orders. If reactify is installed first (and for some reason doesn't see that the react-tools which is also going to be installed meets its version dependency) then it'll install react-tools 0.12. What version of npm are using?

alvinsng commented 9 years ago

@zpao we've been experiencing this issue at Airbnb starting yesterday afternoon. It looks like it is fixed with 0.14.1 version of reactify.

I've create a test React app at https://github.com/alvinsng/react-bug-11.2 that shows the same error

roycehaynes commented 9 years ago

@Natim & @zpao - Thanks guys for validating that I'm not crazy. Basically, reactify upgrades react to 0.12 and creates this issue. Solution is to upgrade reactify to 0.14.1.

zpao commented 9 years ago

In case you aren't following along in the reactify issue, updates were released for all of the branches, locking the react-tools version. I still suspect something related to npm is causing the inconsistent repro, but we should be fine. Thanks for bringing it up!

sardaukar commented 9 years ago

Installing react@0.11.2 installs reactify 0.16, which has this bug again...? I had to downgrade reactify to 0.14.1 for my code to work :-1:

zpao commented 9 years ago

Installing react will not install reactify.