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

TypeError on immutable getFormValues #3488

Closed
erin-doyle opened this issue Oct 6, 2017 · 5 comments
Closed

TypeError on immutable getFormValues #3488

erin-doyle opened this issue Oct 6, 2017 · 5 comments

Comments

@erin-doyle
Copy link

erin-doyle commented Oct 6, 2017

Are you submitting a bug report or a feature request?

bug report

What is the current behavior?

See sandbox link below for demo.

Importing getFormValues like this:

import { getFormValues } from 'redux-form/immutable';

and then using like:

const formValues = getFormValues(NEW_ITEM_FORM_NAME)(state);

throws the TypeError.

What is the expected behavior?

An error is not thrown.

Sandbox Link

https://codesandbox.io/s/1zp260qo6l

What's your environment?

redux-form v7.1.0 (7.0.4 does not exhibit this issue)
Mac OSX 10.11.6
react and react-dom v15.6.1
Issue discovered running Jest tests

Other information

Error stacktrace:

TypeError: (0 , _immutable.isCollection) is not a function

    at getIn (/Users/edoyle/Development/storefront/node_modules/redux-form/lib/structure/immutable/index.js:42:40)
    at nonNullGetFormState (/Users/edoyle/Development/storefront/node_modules/redux-form/lib/selectors/getFormValues.js:11:16)
    at /Users/edoyle/Development/storefront/node_modules/redux-form/lib/selectors/getFormValues.js:13:20
@jmtoung
Copy link

jmtoung commented Oct 7, 2017

I'm getting the same issue - 7.0.4 does not observe this issue but 7.1.0 does.

@ryancurtin
Copy link

Which version of immutable.js are you using? I was able to fix this issue by upgrading to 4.0.0-rc.7.

@erin-doyle
Copy link
Author

I was using immutable version 3.8.1. It does look like updating to version 4.0.0-rc7 fixes the issue in the sandbox I created.

@erikras
Copy link
Member

erikras commented Oct 7, 2017

Oh damn, right. So v7.1.0 migrated to v4.0.0-rc.5 of Immutable (because of React 16 flow issues), which renamed isIterable() to isCollection(). It's kind of impossible to support breaking changes in a third party library. Perhaps I did jump the gun a little bit in using an RC of Immutable, and for that, I apologize. But everyone using Immutable is going to need to migrate to v4 eventually. So if you need to still use v3 of Immutable, you should not yet upgrade to redux-form@7.1.0.

@erikras erikras closed this as completed Oct 7, 2017
@lock
Copy link

lock bot commented Oct 7, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants