Customiser Reload Bug

Short description of issue

Theme Customiser hot reloads and doesn’t save options when using metaobject list schema

Reproduction steps

Create a schema with a type of metaobject list. Here is mine for example.

{
“type”: “metaobject_list”,
“id”: “options”,
“label”: “Options”,
“metaobject_type”: “custom_icon_categories”,
“info”: “Metaobject must have fields: label (text), icon (file_reference)”
}

When trying to select/de-select options, the theme customiser reloads and doesn’t save the options.

Additional info

What type of topic is this

Troubleshooting

1 Like

I’m experiencing the same issue!

Having a similar problem, I was trying to apply some Custom CSS to a section that’s dynamically attached to a metaobject and everytime I made a change it would refresh the UI, but if the CSS wasn’t complete it would delete it - so basically I had to paste in the complete CSS for it to work.

**Edit, I misread this, this probably isn’t related

I think this issue is with a recent cli update…

Does your console return anything?

My problem/solution:

When running shopify dev I get the following error.
“The following Liquid files were updated locally and remotely”
Then listed a bunch of files.

I ran this command in terminal to normalize line endings:

find . -name “*.liquid” -type f -exec sed -i ‘’ ‘s/\r$//’ {} \;

”Removes carriage returns (\r) at the end of lines, converting:

  • CRLF (Windows: \r\n) → LF (Unix: \n)

So it normalizes line endings to Unix-style (LF).”

It seems that dev environment is auto refreshing anything that has these files in it causing this bug. When I ran the bug above it staged the exact files in the list from my error, but there was nothing appearing in the diff, but after pushing the changes I don’t have the issue anymore… but it seems I have to do this on every theme im working on.

Have also experienced the same bug, no meaningful console errors either.