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

Got Cannot read property '@@toStringTag' of undefined #256

Closed
wmertens opened this issue Feb 13, 2019 · 4 comments
Closed

Got Cannot read property '@@toStringTag' of undefined #256

wmertens opened this issue Feb 13, 2019 · 4 comments
Assignees
Labels

Comments

@wmertens
Copy link

Somehow, this line is executed when propValue is undefined:

if (propValue['@@toStringTag'] === 'Symbol') {

It would be good to put a guard and a warning?

@ljharb ljharb added the bug label Feb 13, 2019
@ljharb ljharb self-assigned this Feb 13, 2019
@ljharb
Copy link
Collaborator

ljharb commented Feb 13, 2019

@wmertens do you have any more information? I can't figure out how to reproduce this issue.

@wmertens
Copy link
Author

@ljharb it's being triggered by one of https://github.com/StratoKit/strato-db/blob/1f5535b0bcd0622439f6c70ed6ab2a1acac151d3/src/JsonModel.js#L28-L96

Could it be PropTypes.oneOf([false, undefined, null])?

@ljharb
Copy link
Collaborator

ljharb commented Feb 13, 2019

yes, that is exactly it, thank you :-) (note that oneOf can't ever match undefined or null; if it's optional they'll always be allowed, and if required they'll always be forbidden)

@ljharb ljharb closed this as completed in 6e49d20 Feb 13, 2019
@ljharb
Copy link
Collaborator

ljharb commented Feb 13, 2019

v15.7.2 is released; please file an issue if you see any problems!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants