ParseReact icon indicating copy to clipboard operation
ParseReact copied to clipboard

Updating from 0.3.2 to 0.4.2 throws Uncaught Type Error when loading ParseComponent

Open tristanbbq opened this issue 10 years ago • 11 comments

Updated parse-react from 0.3.2 to latest 0.4.2. Running exact same code/components.

Getting following error:

Uncaught TypeError: Super expression must either be null or a function, not undefined

Anyone else got this issue while updating? If I revert back to 0.3.2 it all loads fine without any error.

tristanbbq avatar Jul 20 '15 00:07 tristanbbq

Seems like this was caused by react not being up-to-date. Now on 0.13.3, but getting a different error:

Uncaught TypeError: Cannot read property '_currentElement' of nullReactCompositeComponentMixin._updateRenderedComponent @ ReactCompositeComponent.js:744

Any idea what's wrong? Again, going back to 0.3.2 I don't get the error, but I'd like to upgrade!

tristanbbq avatar Jul 21 '15 04:07 tristanbbq

just use ParseComponent = require('parse-react/class'); would throw this error.

kidwm avatar Jul 24 '15 15:07 kidwm

@TristanBBQ are you using ES6 and Babel to write/transpile your code? Do you have a small piece of code that can reproduce this bug?

andrewimm avatar Jul 27 '15 20:07 andrewimm

Just encountered this myself. Not sure what's happening, but I'm guessing it's related to the initial render loop of a component. Digging in further...

andrewimm avatar Jul 28 '15 06:07 andrewimm

@andrewimm cool, I'm digging on my side too trying to isolate the issue. Will give more info

tristanbbq avatar Jul 28 '15 21:07 tristanbbq

This dummy component renders fine on parse-react v0.3.2:

import React from 'react';
import { Parse } from 'parse';
import ParseReact from 'parse-react';
import ParseComponent from 'parse-react/class';

class DummyComponent extends ParseComponent {

  constructor(props) {
    super(props);
    this.state = {}
  }

  observe(props, state) {
    return {
      users: new Parse.Query(Parse.User)
    }
  }

  render() {
    return (
      <div>
        { this.data.users[0] }
      </div>
    );
  }
};

DummyComponent.contextTypes = {
  router: React.PropTypes.func.isRequired
};

export default DummyComponent;

Just by updating to latest version (0.4.2), this same component raises this error: ReactCompositeComponent.js:744 Uncaught TypeError: Cannot read property '_currentElement' of null

tristanbbq avatar Jul 29 '15 03:07 tristanbbq

Oh and yes, using ES6 and babel transpiler.

tristanbbq avatar Jul 29 '15 03:07 tristanbbq

I have the same issue: React 0.13.3 Parse-React 0.3.2 (works fine)

On Parse-React 0.4.2 update i get Uncaught TypeError: Super expression must either be null or a function, not undefined

nerijusgood avatar Aug 12 '15 10:08 nerijusgood

@TristanBBQ & @nerijusgood - same here.

jonaswide avatar Aug 12 '15 10:08 jonaswide

@andrewimm @jonaswide @nerijusgood what's your workaround right now? are you stuck on 0.3.2 or did just give up on using ES6 classes?

tristanbbq avatar Aug 29 '15 16:08 tristanbbq

I just rolled back Parse-React

nerijusgood avatar Sep 16 '15 11:09 nerijusgood