Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

fix: prevent error when insert components (#2345)

Bogdan Chadkin2fab05137f03
diff --git a/apps/builder/app/shared/instance-utils.ts b/apps/builder/app/shared/instance-utils.ts
index 287633b8a9..9ae912b913 100644
--- a/apps/builder/app/shared/instance-utils.ts
+++ b/apps/builder/app/shared/instance-utils.ts
@@ -290,16 +290,18 @@ export const insertTemplateData = (
store.createTransaction(
[
instancesStore,
- propsStore,
+ // insert data sources before props to avoid error
+ // about missing data source when compute data source logic
dataSourcesStore,
+ propsStore,
styleSourceSelectionsStore,
styleSourcesStore,
stylesStore,
],
(
instances,
- props,
dataSources,
+ props,
styleSourceSelections,
styleSources,
styles