meteor / react-packages

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

Upgrading to Meteor 1.5 - createContainer throws: Super expression must either be null or a function, not undefined #225

Closed Nugen89 closed 3 years ago

Nugen89 commented 7 years ago

After upgrading from Meteor 1.4 to 1.5 createContainer throws the following error:

Uncaught TypeError: Super expression must either be null or a function, not undefined
    at exports.default (modules.js?hash=fb99b6a…:1144)
    at ReactMeteorData.jsx:6
    at ReactMeteorData.jsx:6
    at createContainer (createContainer.jsx:16)
    at AppContainer.jsx (AppContainer.jsx:8)

AppContainer.jsx

import { Meteor } from 'meteor/meteor';
import { Session } from 'meteor/session';
import { createContainer } from 'meteor/react-meteor-data';

import App from '../layouts/App.jsx';

export default AppContainer = createContainer(props => {
  return {
    currentUser: Meteor.user(),
  };
}, App);
dburles commented 7 years ago

Hey @Nugen89 did you end up resolving this problem?

SevenZark commented 7 years ago

TL;DR: I'm having the same issue in a fairly new app. I have isolated the problem to just adding react-meteor-data, when not even using the package in the app code.

I'm having the same problem in a new meteor app I created yesterday. Wrote some code and it was working fine. Then I added react-meteor-data and, upon running meteor, I get the same error message:

TypeError: Super expression must either be null or a function, not undefined
    at exports.default (/Users/[redacted]/Source/hourglass/node_modules/babel-runtime/helpers/inherits.js:21:11)
    at /Users/[redacted]/Source/hourglass/.meteor/local/build/programs/server/packages/react-meteor-data.js:289:26
    at meteorInstall.node_modules.meteor.react-meteor-data.ReactMeteorData.jsx (/Users/[redacted]/Source/hourglass/.meteor/local/build/programs/server/packages/react-meteor-data.js:297:2)
    at fileEvaluate (packages/modules-runtime.js:333:9)
    at require (packages/modules-runtime.js:228:16)
    at meteorInstall.node_modules.meteor.react-meteor-data.createContainer.jsx (packages/react-meteor-data/createContainer.jsx:1:136)
    at fileEvaluate (packages/modules-runtime.js:333:9)
    at require (packages/modules-runtime.js:228:16)
    at meteorInstall.node_modules.meteor.react-meteor-data.react-meteor-data.jsx (packages/react-meteor-data/react-meteor-data.jsx:1:14)
    at fileEvaluate packages/modules-runtime.js:333:9)

I then deleted the import and createcontainer statements from my code. So, nothing is presently loading or using react-meteor-data. However, upon running meteor again I get the same error. Finally, I removed the react-meteor-data package, ran meteor again, and the error went away and everything ran fine. When I added react-meteor-data again the error came back.

I'm on Meteor 1.5.2.1. Here's my packages file:

# Meteor packages used by this project, one per line.
# Check this file (and the other files in this directory) into your repository.
#
# 'meteor add' and 'meteor remove' will edit this file for you,
# but you can also edit it by hand.

meteor-base@1.1.0             # Packages every Meteor app needs to have
mobile-experience@1.0.5       # Packages for a great mobile UX
mongo@1.2.2                   # The database Meteor supports right now
static-html             # Define static page content in .html files
reactive-var@1.0.11            # Reactive variable for tracker
tracker@1.1.3                 # Meteor's client-side reactive programming library

standard-minifier-css@1.3.5   # CSS minifier run for production mode
standard-minifier-js@2.1.2    # JS minifier run for production mode
es5-shim@4.6.15                # ECMAScript 5 compatibility for older browsers
ecmascript@0.8.2              # Enable ECMAScript2015+ syntax in app code
shell-server@0.2.4            # Server-side component of the `meteor shell` command
kadira:flow-router
accounts-base
accounts-password
fourseven:scss
react-meteor-data

And here's package.json:

{
  "name": "hourglass",
  "private": true,
  "scripts": {
    "start": "meteor run"
  },
  "dependencies": {
    "babel-runtime": "^6.20.0",
    "meteor-node-stubs": "~0.2.4",
    "react": "^15.0.0",
    "react-addons-pure-render-mixin": "^15.6.2",
    "react-dom": "^15.0.0",
    "react-mounter": "^1.2.0",
    "simpl-schema": "^0.3.2"
  }
}
SevenZark commented 7 years ago

UPDATE: Fixed my problem by changing my package.json file, after checking npm packages in another project which was working.

Changed: "react": "^15.0.0" To: "react": "^15.6.1"

Changed: "react-dom": "^15.0.0" To: "react-dom": "^15.6.1"

filipenevola commented 3 years ago

I'm closing this just because it's too old. We can open new issues for items that are still valid.

Most of these items were solved already or replaced by new strategies (like hooks)