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

Custom component with many localized fields freezes entire Builder editor and throws many errors in console #3050

Open
mimoid-prog opened this issue Mar 15, 2024 · 1 comment
Assignees

Comments

@mimoid-prog
Copy link

mimoid-prog commented Mar 15, 2024

Describe the bug
Custom component with many localized fields freezes entire Builder editor and throws many errors in console. The more localized fields the bigger frezee and lags occur.

To Reproduce
You can clone the repo from here: https://github.com/mimoid-prog/svelte-kit-builder-localized-error

Steps to reproduce the behavior:

  1. Create custom component, define many fields with localized: true, register this component
  2. Put component on the page
  3. Try to edit it's properties
  4. Entire Builder editor freezes, you can't click nothing, console is full of errors

Expected behavior
Properties should be available to edit instantly, there should not be errors in console.

Screenshots
Video:

0315.mov
Screenshot 2024-03-15 at 13 07 21

Additional context
Node.js - 20.9.0

@samijaber
Copy link
Contributor

@mimoid-prog We made a fix for the specific issue you shared a screenshot of.

However, another issue persists. It is specifically tied to the Content Input favoriteTechStack being a localized list. We are actively investigating this and will follow up with you.

I want to point out that you are setting localized: true to both the list and all of its internal individual fields. That is unusual, as you would usually either want to localize the entire array, or the individual objects within, but not both.

If you remove the localized key from the parent list:

{
			name: 'favoriteTechStack',
			type: 'list',
			defaultValue: [
				{
					name: 'Svelte',
					description: 'A compiler for building user interfaces.'
				}
			],
-			localized: true,
			subFields: [
				{
					name: 'name',
					type: 'text',
					defaultValue: 'Svelte',
					localized: true
				},
				{
					name: 'description',
					type: 'text',
					defaultValue: 'A compiler for building user interfaces.',
					localized: true
				}
			]
		}

Then your example now works and no longer freezes. Would that be satisfactory in unblocking you? If not: what need do you have for localizing the entire array?

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