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

Build error for some components after update #97

Closed
silveltman opened this issue Mar 3, 2022 · 6 comments
Closed

Build error for some components after update #97

silveltman opened this issue Mar 3, 2022 · 6 comments

Comments

@silveltman
Copy link

silveltman commented Mar 3, 2022

I just updated bookshop from 2.4 > 2.6 and run into this error for some of my components: TypeError: Converting circular structure to JSON

I ran into this before, when calling a component inside a forloop (to which I found a workaround: #79). For this one however, I can't seem to recognise a pattern, therefore a clear cause. It seems to me quiet random.

For instance, a simple component like this doesn't work

map.eleventy.liquid

<div class="map">
  <iframe src="{{ url }}"></iframe>
</div>

page.liquid
{% bookshop "map" url: "test" %}
while other, more complex, components do still work.

Site (in cloudcannon): https://quiet-beech.cloudvent.net/
In the following files I commented out the components that broke: routes.liquid, aanbod.liquid, carousel.eleventy.liquid

@bglw
Copy link
Contributor

bglw commented Mar 3, 2022

Ah, sorry about that. I have just released 2.6.1 which I believe should fix the issue(s) you're seeing. Let me know if it doesn't!

@bglw bglw closed this as completed Mar 3, 2022
@silveltman
Copy link
Author

just updated, but still seeing the same issues 😬

@silveltman
Copy link
Author

@bglw Can this issue be opened again please?

@bglw
Copy link
Contributor

bglw commented Mar 27, 2022

Apologies, certainly! I'm working on a Bookshop 3.0 release soon, so I'll look at including a fix there.

@bglw bglw reopened this Mar 27, 2022
@bglw
Copy link
Contributor

bglw commented Apr 6, 2022

👋 Hi @silveltman

Firstly, Bookshop 3.0 is out — see the Migration Guide and Release Notes 🙂

I had a look at those components, and it looks like the main issue is around the templating in your layout transforming the data before passing it to the Bookshop component.

I have added some discussion around this to the new documentation here: Passing Data to Bookshop Components. Essentially, part of this error is that any reassignments in your layout can't be known once the component is in the visual editor, so it doesn't have the data to re-render correctly.

Bookshop 3 now lets you access site data and collections directly from Eleventy components in the live editor, so moving more of that logic into your components will improve things.

Additionally, there was a bug here causing the TypeError: Converting circular structure to JSON crash in your Eleventy build — this has been fixed in 3.0 😄

I'll leave this issue open to cover any other issues you face migrating to 3.0

@bglw
Copy link
Contributor

bglw commented Jun 17, 2022

Closing this now — let me know if this one is still lingering

@bglw bglw closed this as completed Jun 17, 2022
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

No branches or pull requests

2 participants