welovedevs / react-ultimate-resume

💼 🎨 A modern software developer resume built with React and JSONResume
https://welovedevs.com/react-ultimate-resume
GNU Affero General Public License v3.0
2.13k stars 625 forks source link

[Bug] TypeError: Cannot read property '0' of undefined #53

Closed guilatrova closed 4 years ago

guilatrova commented 4 years ago

After deleting yarn.lock to retry a fresh install, whenever I click "Customize" it suddenly breaks with this message:

TypeError: Cannot read property '0' of undefined
(anonymous function)
src/package/components/banner/user_actions_row/customize_dialog/palettes_list/palettes_list.jsx:97
   94 | palette={['primary', 'secondary', 'tertiary'].reduce(
   95 |     (acc, keyName, index) => ({
   96 |         ...acc,
>  97 |         [keyName]: { 500: item[index] }
      | ^   98 |     }),
   99 |     {}
  100 | )}
View compiled
(anonymous function)
src/package/components/banner/user_actions_row/customize_dialog/palettes_list/palettes_list.jsx:94
  91 |     tooltipPopper: classes.tooltipPopper,
  92 |     color: classes.paletteVisualColor
  93 | }}
> 94 | palette={['primary', 'secondary', 'tertiary'].reduce(
     | ^  95 |     (acc, keyName, index) => ({
  96 |         ...acc,
  97 |         [keyName]: { 500: item[index] }
View compiled
PalettesListCom
clementdevos commented 4 years ago

Hey i think you shouldn't remove yarn.lock as it takes some liberties with the minor/beta versions, especially with react-spring which is still very much in beta right now

I've addressed this issue here https://github.com/welovedevs/react-ultimate-resume/issues/48#issuecomment-644036760

It kinda sucks but while react-spring is not stable, i'm not taking the risk to have to change everything again in 2 weeks if their API changes soon.

TL;DR : don't use libraries in beta versions. :)

clementdevos commented 4 years ago

closing this in favor of #48