meteor / react-packages

Meteor packages for a great React developer experience
http://guide.meteor.com/react.html
Other
574 stars 159 forks source link

Meteor 1.6 "Class extends value undefined is not a constructor or null" #244

Closed katk0smos closed 6 years ago

katk0smos commented 6 years ago

I'm attempting to get this setup with Flow Router, and am running into this error:

/home/thewaffledimension/.meteor/packages/meteor-tool/.1.6.0_1.obe9u1++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:280
                        throw(ex);
                        ^

TypeError: Class extends value undefined is not a constructor or null
    at ReactMeteorData.jsx (packages/react-meteor-data/ReactMeteorData.jsx:164:40)
    at fileEvaluate (packages/modules-runtime.js:343:9)
    at require (packages/modules-runtime.js:238:16)
    at createContainer.jsx (packages/react-meteor-data/createContainer.jsx:1:210)
    at fileEvaluate (packages/modules-runtime.js:343:9)
    at require (packages/modules-runtime.js:238:16)
    at react-meteor-data.jsx (packages/react-meteor-data/react-meteor-data.jsx:1:14)
    at fileEvaluate (packages/modules-runtime.js:343:9)
    at require (packages/modules-runtime.js:238:16)
    at /home/thewaffledimension/projects/web/react-app/.meteor/local/build/programs/server/packages/react-meteor-data.js:332:15
Exited with code: 1
crapthings commented 6 years ago

@TheWaffleDimension

import { mount } from 'react-mounter'
import { withTracker } from 'meteor/react-meteor-data'

const Layout = ({ children }) => <div>{children()}</div>

const HomeTracker = props => {
  return { title: 'Home' }
}

const HomeComponent = ({ title }) => <div>{title}</div>

const Home = withTracker(HomeTracker)(HomeComponent)

FlowRouter.route('/', {
  action() {
    mount(Layout, {
      children: () => <Home />
    })
  }
})
katk0smos commented 6 years ago

Thanks @crapthings . Not sure why it wasn't working before, but copying and pasting your code in and modifying it to fit my application made it work.

chip commented 6 years ago

I'm running into the same thing with Meteor 1.6.1.1 and FlowRouter 2.12.1:

W20180521-19:19:05.342(-5)? (STDERR) /Users/chip/.meteor/packages/meteor-tool/.1.6.1_1.1hnw4g8++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:280
W20180521-19:19:05.343(-5)? (STDERR)                                            throw(ex);
W20180521-19:19:05.343(-5)? (STDERR)                                            ^                             W20180521-19:19:05.343(-5)? (STDERR) 
W20180521-19:19:05.343(-5)? (STDERR) TypeError: Class extends value undefined is not a constructor or null    W20180521-19:19:05.343(-5)? (STDERR)     at ReactMeteorData.jsx (packages/react-meteor-data/ReactMeteorData.js
x:164:40)                                                                                                     W20180521-19:19:05.344(-5)? (STDERR)     at fileEvaluate (packages/modules-runtime.js:343:9)
W20180521-19:19:05.344(-5)? (STDERR)     at require (packages/modules-runtime.js:238:16)              [0/4793]
W20180521-19:19:05.344(-5)? (STDERR)     at createContainer.jsx (packages/react-meteor-data/createContainer.js
x:1:210)
W20180521-19:19:50.829(-5)? (STDERR)     at fileEvaluate (packages/modules-runtime.js:343:9)
W20180521-19:19:50.830(-5)? (STDERR)     at require (packages/modules-runtime.js:238:16)
W20180521-19:19:50.830(-5)? (STDERR)     at react-meteor-data.jsx (packages/react-meteor-data/react-meteor-dat
a.jsx:1:139)
W20180521-19:19:50.831(-5)? (STDERR)     at fileEvaluate (packages/modules-runtime.js:343:9)
W20180521-19:19:50.831(-5)? (STDERR)     at require (packages/modules-runtime.js:238:16)
W20180521-19:19:50.831(-5)? (STDERR)     at /Users/chip/code/tracker-app/.meteor/local/build/programs/server/p
ackages/react-meteor-data.js:330:15
W20180521-19:19:50.831(-5)? (STDERR)     at /Users/chip/code/tracker-app/.meteor/local/build/programs/server/p
ackages/react-meteor-data.js:337:3
W20180521-19:19:50.832(-5)? (STDERR)     at infos.forEach.info (/Users/chip/code/tracker-app/.meteor/local/bui
ld/programs/server/boot.js:418:13)
W20180521-19:19:50.832(-5)? (STDERR)     at Array.forEach (<anonymous>)
W20180521-19:19:50.832(-5)? (STDERR)     at /Users/chip/code/tracker-app/.meteor/local/build/programs/server/b
oot.js:417:9
W20180521-19:19:50.833(-5)? (STDERR)     at /Users/chip/code/tracker-app/.meteor/local/build/programs/server/b
oot.js:471:5
W20180521-19:19:50.833(-5)? (STDERR)     at Function.run (/Users/chip/code/tracker-app/.meteor/local/build/pro
grams/server/profile.js:510:12)
W20180521-19:19:50.885(-5)? (STDERR) Waiting for the debugger to disconnect...

I also commented out all routes except for /, which doesn't need withTracker because it doesn't subscribe to any data, yet I still see this error. Should I abandon FlowRouter? Any other suggestions for fixing this? Thanks in advance.