question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Uncaught Error: Not able to resolve schema - appeared when migrated to 1.0.0-beta-9

See original GitHub issue

I migrated from firecms [1.0.0-beta5] to [1.0.0-beta9] and when I’m creating a collection, that has conditional array of references it returns error: image image

The problem part:

var TypeOfReference: string = "";
var reference: number = 0;

typeOfReference: ({ values }) =>
{
	const properties = buildProperties<any>({
		string: {
			title: "Type of reference",
			validation: {
				required: true
			},
			dataType: "string",
			config: {
				enumValues: {
					product: "Product",
					menu: "Menu",
				}
			}
		}
	})

	TypeOfReference = values.typeOfReference ? values.typeOfReference : "";
	
	return ({
		dataType: "string",
		title: "Source",
		disabled: reference>0,
		properties: properties,
		validation: {
			required: true,
		},
		config: {
			enumValues: {
				dishes: "Dishes",
				menu: "Menu",
			}
		}
	});
	},
reference: ({ values }) =>
{
	reference = values.reference?.length ? values.reference?.length : 0

	return ({
		dataType: "array",
		disabled: (TypeOfReference !== "menu" && TypeOfReference !== "dishes"),
		title: (TypeOfReference !== "menu" && TypeOfReference !== "dishes") ? "" : TypeOfReference === "menu" ? "Menu" : "Dishes",
		validation: {
			required: true,
		},
		of: {
			dataType: "reference",
			path: TypeOfReference,
		}
	});
},

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:15 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
fgatti675commented, Feb 17, 2022

Hi @alixain You are missing a brands collection in your navigation. FireCMS does not point to Firestore collections, but to it’s own ones, which have a schema attached, so the views can be built. You need to add your brands collection at the same level as the products one:

  return ({
      collections: [
          buildCollection({
              path: "products",
              schema: productSchema,
              name: "Products",
              permissions: ({ authController }) => ({
                  edit: true,
                  create: true,
                  delete: authController.extra.roles.includes("admin")
              }),
              subcollections: [
                  buildCollection({
                      name: "Unit & Stock",
                      path: "units",
                      schema: units
                  })
              ]
          }),
          buildCollection({
              path: "brands",
              schema: brandSchema
      // ...
          })
    ]
})
            ```
0reactions
fgatti675commented, Feb 17, 2022

Welcome!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Prisma Migrate: Error creating shadow database #4571 - GitHub
Problem Users run into this issue if their database user has no privileges to create databases (MySQL / Postgres).
Read more >
How do I resolve issues with missing or incorrect schema ...
1: A startup error similar one of these is seen for a new environment. com.ibm.ws.exception.RuntimeError: Database version is not found in table ...
Read more >
flyway exception, detected failed migration - Stack Overflow
"FlywayException: Detected failed migration to version 1.0". it means that you ran migrate before and it failed at 1.0 for some reason.
Read more >
ERROR: Migration task failed to complete - DataStax Support
The migration tasks basically means getting the schemas from other nodes. The node won't bootstrap unless the migration tasks complete first.
Read more >
Troubleshooting Migration Manager - Microsoft 365
Troubleshoot common errors in Migration Manager. ... Geo admins not supported; Group inherited SharePoint admins unable to access scans and ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found