facebookarchive / react-meteor

React rendering for Meteor apps
948 stars 113 forks source link

react/addons? #33

Open tehfailsafe opened 9 years ago

tehfailsafe commented 9 years ago

After cloning into packages/react, I was getting an error with react-addons.

Error: Can't find npm module 'react/addons'. Did you forget to call 'Npm.depends' in package.js within the 'react' package?

Editting package.js resolves the issue, but not what is causing it?

Npm.depends({
  "react": reactVersion,
  "react-addons": "0.9.0",
});
ryenbeatty commented 9 years ago

I had a similar issue, after cloning and running

meteor

I had the following error:

error: couldn't install npm package
While building plugin `compileJSX` in package `react`:
error: couldn't install npm package

So, i installed the react-tools package via npm

npm install -g react-tools

and modified packages.js to include react-tools

Npm.depends({
  "react": reactVersion,
  "react-tools": "0.12.2",
});

after this, the app started 0_o

benjamn commented 9 years ago

Hmm, react-addons is deprecated, and react-tools shouldn't be necessary for anything except the compiler plugin.

@ryenbeatty can you check if packages/react/.npm/plugin/compileJSX/node_modules/react-tools/ exists?

@tehfailsafe what version do you see in packages/react/.npm/package/node_modules/react/package.json?

tehfailsafe commented 9 years ago

@benjamn The react package lists "version": "0.12.2"

Now if I remove the react-tools from Npm.depends it still works and does not give the error above. Is there a path issue for the jsx compiler somehow since I had never used react-tools in the past?

jemgold commented 9 years ago

I accidentally cloned benjamn/react-meteor rather than this repo a few days ago (typo in README, now fixed) and had up to date packages.

After fixing them, I ran into issues with React = Npm.require("react/addons"); in require-react.js; caused by a bug in Meteor https://github.com/meteor/meteor/pull/3526 . This has now been fixed but hasn't made it's way to master yet so you need to run meteor direct from a GitHub checkout

hellogerard commented 9 years ago

I can confirm this. I had the same error, and running the devel branch of meteor fixes the issue.

quin commented 9 years ago

So what is the best solution to fix this? I am also getting the same error

ramsaylanier commented 9 years ago

I'm also getting this error as well.

tehfailsafe commented 9 years ago

If you just want to get it up and working until meteor is updated, just add react-tools to the package.json It seems overkill but it works.

Npm.depends({
  "react": reactVersion,
  "react-tools": reactVersion,
});
ramsaylanier commented 9 years ago

I'm assuming you mean add it to the package.js file? I have and I still get the error.

tehfailsafe commented 9 years ago

Yes, package.js sorry! Strange, that worked for me. And now after the most recent update I don't have it in there anymore at all...

hellogerard commented 9 years ago

To get this working, do everything as normal, except that you have to run the devel branch of meteor:

  1. Clone the meteor repo into a folder parallel to your project.
  2. Make sure you are on the devel branch (the default, I believe)
  3. In your project, instead of running meteor, run ../meteor/meteor.
vabruzzo commented 9 years ago

works like a charm! thanks hellogerard

IstoraMandiri commented 9 years ago

Yup, working on devel. Hopefully this gets released soon.

quin commented 9 years ago

Thanks, that works. Let's hope master gets updated soon

ccorcos commented 9 years ago

I cant find a devel branch...

ccorcos commented 9 years ago

This package is currently broken btw.

benjamn commented 9 years ago

@ccorcos https://github.com/meteor/meteor/tree/devel is the main development branch of the Meteor repository, which should be released soon…

ccorcos commented 9 years ago

Ahh. I thought you were talking about this package. How do I run meteor from the devel branch?

IstoraMandiri commented 9 years ago

@ccorcos take a look at @hellogerard 's comment above.

To get this working, do everything as normal, except that you have to run the devel branch of meteor:

Clone the meteor repo into a folder parallel to your project. Make sure you are on the devel branch (the default, I believe) In your project, instead of running meteor, run ../meteor/meteor.

ccorcos commented 9 years ago

Ah. Now I get it haha. Thanks!

cwaring commented 9 years ago

The fix has now made its way into the 1.0.4 RC. You can update your project using: meteor update --release 1.0.4-rc.0

reduxdj commented 9 years ago

does not work: meteor update --release 1.0.4-rc.0

/Users/PatrickDj/.meteor/packages/meteor-tool/.1.0.42-rc.1.13ilyv9++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:245 W20150626-08:56:37.046(-7)? (STDERR) throw(ex); W20150626-08:56:37.047(-7)? (STDERR) ^ W20150626-08:56:37.048(-7)? (STDERR) Error: Cannot find module 'react-tools'

=> Your application is crashing. Waiting for file change.

reduxdj commented 9 years ago

and still after another update:

/Users/PatrickDj/.meteor/packages/meteor-tool/.1.1.3.1wysac9++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:245 W20150626-08:58:47.987(-7)? (STDERR) throw(ex); W20150626-08:58:47.987(-7)? (STDERR) ^ W20150626-08:58:47.989(-7)? (STDERR) Error: Cannot find module 'react-tools' W20150626-08:58:47.989(-7)? (STDERR) at Function.Module._resolveFilename (module.js:338:15) W20150626-08:58:47.989(-7)? (STDERR) at Function.Module._load (module.js:280:25) W20150626-08:58:47.989(-7)? (STDERR) at Module.require (module.js:364:17) W20150626-08:58:47.989(-7)? (STDERR) at require (module.js:380:17) W20150626-08:58:47.989(-7)? (STDERR) at Object.Npm.require (/Users/PatrickDj/wild_cultivar/.meteor/local/build/programs/server/boot.js:130:18) W20150626-08:58:47.989(-7)? (STDERR) at app/react-meteor/plugin/compile-jsx.js:1:57 W20150626-08:58:47.990(-7)? (STDERR) at app/react-meteor/plugin/compile-jsx.js:18:3 W20150626-08:58:47.990(-7)? (STDERR) at /Users/PatrickDj/wildcultivar/.meteor/local/build/programs/server/boot.js:222:10 W20150626-08:58:47.990(-7)? (STDERR) at Array.forEach (native) W20150626-08:58:47.990(-7)? (STDERR) at Function..each._.

reduxdj commented 9 years ago

+1, anybody have this working?

fvpDev commented 8 years ago

+1

povtasci commented 7 years ago

try this npm install --save react-addons-pure-render-mixin