meteorhacks / npm

Complete NPM integration for Meteor
http://meteorhacks.com/complete-npm-integration-for-meteor.html
MIT License
508 stars 43 forks source link

React-Router breaks with `toUpperCase` not defined #88

Closed AdamBrodzinski closed 9 years ago

AdamBrodzinski commented 9 years ago

I'm not sure if this is a meteorhacks:npm issue but the source of the problem seems to be that React-Router expects modules to use module.exports (based on previous issues). Have you ran into this problem before?

TypeError: Object #<Object> has no method 'toUpperCase'
    at autoGenerateWrapperClass (packages/node_modules/react/lib/ReactDefaultInjection.js:53:1)
    at Object.getComponentClassForElement (packages/node_modules/react/lib/ReactNativeComponent.js:59:1)
    at validatePropTypes (packages/node_modules/react/lib/ReactElementValidator.js:361:1)
    at Object.ReactElementValidator.createElement (packages/node_modules/react/lib/ReactElementValidator.js:408:1)
    at Function.<anonymous> (server/routes.jsx:24:37)
    at Function.dispatchHandler (/Users/adam/projects/ssr-test/.meteor/local/isopacks/npm-container/npm/node_modules/react-router/lib/createRouter.js:381:22)
    at /Users/adam/projects/ssr-test/.meteor/local/isopacks/npm-container/npm/node_modules/react-router/lib/createRouter.js:349:29
    at /Users/adam/projects/ssr-test/.meteor/local/isopacks/npm-container/npm/node_modules/react-router/lib/Transition.js:69:9
    at /Users/adam/projects/ssr-test/.meteor/local/isopacks/npm-container/npm/node_modules/react-router/lib/Transition.js:69:9
    at Function.Transition.to (/Users/adam/projects/ssr-test/.meteor/local/isopacks/npm-container/npm/node_modules/react-router/lib/Transition.js:72:15)

I also have a test repo here if you're interested:
https://github.com/AdamBrodzinski/meteor-react-ssr-spike

If I call renderToString on Home all is fine, but if I call it on Router it gets throws.

arunoda commented 9 years ago

Frankly, I am quite not sure where this is coming from.

On 2015 ජූනි 29, සඳුදා at ප.ව. 8.31 Adam Brodzinski < notifications@github.com> wrote:

I'm not sure if this is a meteorhacks:npm issue but the source of the problem seems to be that React-Router expects modules to use module.exports (based on previous issues). Have you ran into this problem before?

TypeError: Object # has no method 'toUpperCase' at autoGenerateWrapperClass (packages/node_modules/react/lib/ReactDefaultInjection.js:53:1) at Object.getComponentClassForElement (packages/node_modules/react/lib/ReactNativeComponent.js:59:1) at validatePropTypes (packages/node_modules/react/lib/ReactElementValidator.js:361:1) at Object.ReactElementValidator.createElement (packages/node_modules/react/lib/ReactElementValidator.js:408:1) at Function. (server/routes.jsx:24:37) at Function.dispatchHandler (/Users/adam/projects/ssr-test/.meteor/local/isopacks/npm-container/npm/node_modules/react-router/lib/createRouter.js:381:22) at /Users/adam/projects/ssr-test/.meteor/local/isopacks/npm-container/npm/node_modules/react-router/lib/createRouter.js:349:29 at /Users/adam/projects/ssr-test/.meteor/local/isopacks/npm-container/npm/node_modules/react-router/lib/Transition.js:69:9 at /Users/adam/projects/ssr-test/.meteor/local/isopacks/npm-container/npm/node_modules/react-router/lib/Transition.js:69:9 at Function.Transition.to (/Users/adam/projects/ssr-test/.meteor/local/isopacks/npm-container/npm/node_modules/react-router/lib/Transition.js:72:15)

I also have a test repo here if you're interested:

https://github.com/AdamBrodzinski/meteor-react-ssr-spike

If I call renderToString on Home all is fine, but if I call it on Router it gets throws.

— Reply to this email directly or view it on GitHub https://github.com/meteorhacks/npm/issues/88.

AdamBrodzinski commented 9 years ago

Oh ok, thanks for the quick reply! I wasn't sure if this was a common thing. Look like it's not :frowning: . I'll keep digging. Feel free to close this if it's not in scope with the npm package.

arunoda commented 9 years ago

I think we can close it. Anyway, if you find the issue try to put it here too. May be it'll be helpful for someone else.

AdamBrodzinski commented 9 years ago

Yep will do. Closing.

arunoda commented 9 years ago

Great.

On Mon, Jun 29, 2015 at 8:40 PM Adam Brodzinski notifications@github.com wrote:

Closed #88 https://github.com/meteorhacks/npm/issues/88.

— Reply to this email directly or view it on GitHub https://github.com/meteorhacks/npm/issues/88#event-343128734.

john-osullivan commented 8 years ago

I don't know where this is coming from but I'm running into it as well!

AdamBrodzinski commented 8 years ago

@john-osullivan one of your components is most likely undefined. This is really common in React Native when I import the wrong path or forget to export a module.