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 trying to delete an old components #671

Closed
BR1G00 opened this issue Oct 24, 2024 · 7 comments · Fixed by #681
Closed

Error trying to delete an old components #671

BR1G00 opened this issue Oct 24, 2024 · 7 comments · Fixed by #681
Labels
ready Assumed ready enough to start type: bug 🐛

Comments

@BR1G00
Copy link

BR1G00 commented Oct 24, 2024

If i delete a component from the config, but it is saved in the puck object, when i load the page where the component was, i can see "No configuration for [componentName]", but if i try to interact with it to delete it, the editor crash with this error.
I am on the last canary version "0.16.2-canary.525b506".
Immagine 1940x1690

@the-code-raccoon
Copy link

the-code-raccoon commented Oct 29, 2024

Also ran into this issue too. At least to my knowledge there is no way for Puck to automatically deal with this case. Instead I wrote a function that checks over all components in the raw puck data before rendering it or opening it in the editor

const filterUnknownComponents = (puckData) => {
  const config = getPuckConfig()

  return {
    ...puckData,
    content: puckData.content.filter((item) => config.components[item.type]),
  }
}

@chrisvxd chrisvxd added ready Assumed ready enough to start type: bug 🐛 labels Oct 29, 2024
@chrisvxd
Copy link
Member

Thanks @BR1G00, I also encountered this one. Marked as a bug and ready.

@chrisvxd
Copy link
Member

@BR1G00 think this might actually be fixed in canary via #665. Could you confirm?

@mkilpatrick
Copy link
Contributor

Can confirm this fixes it.

@BR1G00
Copy link
Author

BR1G00 commented Oct 31, 2024

#665

@chrisvxd Before that commit I couldn't even see "No configuration for [componentName]", after that I can see the component, but when I click on it it crashes with the attached error

@chrisvxd
Copy link
Member

Apologies, your issue description mentions that canary. Will keep this open.

@chrisvxd
Copy link
Member

chrisvxd commented Nov 6, 2024

@BR1G00 this should be out in latest v0.16.2 canary as soon as deployed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready Assumed ready enough to start type: bug 🐛
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants