Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error upgrading to v3.2.0 #49

Closed
digocesar opened this issue Jun 4, 2019 · 3 comments · Fixed by #66
Closed

Error upgrading to v3.2.0 #49

digocesar opened this issue Jun 4, 2019 · 3 comments · Fixed by #66

Comments

@digocesar
Copy link

I didn't make any change in my code. Just updated package from 3.1.3 to 3.2.0 and I'm getting this error at Bowser Console.

app.js:10124 Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file its defined in. Check the render method of If.
    in If (created by PageFooter)
    in div (created by PageFooter)
    in div (created by PageFooter)
    in footer (created by PageFooter)
    in PageFooter (created by Connect(PageFooter))
    in Connect(PageFooter) (created by App)
    in div (created by App)
    in div (created by App)
    in DocumentTitle (created by SideEffect(DocumentTitle))
    in SideEffect(DocumentTitle) (created by App)
    in App (created by Connect(App))
    in Connect(App)
    in Provider

app.js:10294 Uncaught Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file its defined in. Check the render method of If.
    at invariant (http://localhost:5000/app.js:10294:16)
    at ReactCompositeComponentWrapper.instantiateReactComponent [as _instantiateReactComponent] (http://localhost:5000/app.js:25172:56)
    at ReactCompositeComponentWrapper.performInitialMount (http://localhost:5000/app.js:25596:23)
    at ReactCompositeComponentWrapper.mountComponent (http://localhost:5000/app.js:25487:22)
    at Object.mountComponent (http://localhost:5000/app.js:17982:36)
    at ReactDOMComponent.mountChildren (http://localhost:5000/app.js:24634:45)
    at ReactDOMComponent._createInitialChildren (http://localhost:5000/app.js:21718:33)
    at ReactDOMComponent.mountComponent (http://localhost:5000/app.js:21537:13)
    at Object.mountComponent (http://localhost:5000/app.js:17982:36)
    at ReactDOMComponent.mountChildren (http://localhost:5000/app.js:24634:45)

app.js:14605 Uncaught TypeError: Cannot read property __reactInternalInstance$t7ajv2eucf of null
    at Object.getClosestInstanceFromNode (app.js:14605)
    at findParent (app.js:28238)
    at handleTopLevelImpl (app.js:28267)
    at ReactDefaultBatchingStrategyTransaction.perform (app.js:18964)
    at Object.batchedUpdates (app.js:28192)
    at Object.batchedUpdates (app.js:17634)
    at dispatchEvent (app.js:28347)

Could this be a conflict with other outdated package? I'm using react 15.6.2.

@romac
Copy link
Owner

romac commented Jun 4, 2019

Do you get the same issue with v3.4.1?

In any case, that's pretty weird because, looking at https://github.com/romac/react-if/blob/v3.2.0/lib/ReactIf.js, it looks like everything is exported properly.

Can you put together a minimal testcase for me reproduce?

@romac romac changed the title Error upgrading to v.3.2.0 Error upgrading to v3.2.0 Jun 4, 2019
@digocesar
Copy link
Author

Error occurs with v3.4.1 too.
A testcase can be downloaded at https://drive.google.com/open?id=13AEvH74Bv6tcvc6lm9fOpSHF_QaSlXP5
Can you see it if happens to you too?

@favna
Copy link
Collaborator

favna commented Oct 21, 2020

I'll be closing this with #66. For one because this is a very old issue by now, because I see you were still using React 15 in your sample app which is beyond outdated (React 16 released way back in September 2017, this issue is from 2019, and it's near the end of 2020 and we got React 17 yesterday), and lastly because #66 is a complete rewrite of the library that, if not fixing the issue, will definitely target React >= 16 and I can greatly recommend you switch to Reac 16.

@favna favna closed this as completed in #66 Oct 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants