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

[Bug] TypeError: Cannot read property 'toString' of undefined #15

Closed
TSMMark opened this issue Jul 1, 2019 · 1 comment · Fixed by #16
Closed

[Bug] TypeError: Cannot read property 'toString' of undefined #15

TSMMark opened this issue Jul 1, 2019 · 1 comment · Fixed by #16

Comments

@TSMMark
Copy link

TSMMark commented Jul 1, 2019

Possibly same as #3, but I may have found the issue. I traced it back to this one destructuring expression:

const {
  id,
  [`${assetType}_remaining_payee_percentage`]: remainingPayeePercentage,
} = media || {}

Strongly believe this is due to the dynamic / interpolated key, because if the interpolated key is replaced with a static one, I no longer get the error.

@TSMMark
Copy link
Author

TSMMark commented Jul 1, 2019

Interestingly, if I pull the interpolated string into a const it works even with the dynamic lookup. I.e. with this code I get no error:

const key = `${assetType}_remaining_payee_percentage`
const {
  id,
  [key]: remainingPayeePercentage,
} = media || {}

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.

1 participant