Sometimes it returns undefined, even though the page url is defined well. If we make a very small irrelevant change like change the page name, or just wait a while - then it suddenly works out and returns the page.
For example here:
We have “@builder.io/react”: “^2.1.0”,
But also failed with 3.0.1
@adam, Unfortunately, I’m able to reproduce the issue on my end. Could you please help us with sharing a couple of page URLs where you’re seeing undefined errors or would be great if you can share a screen recording for further investigation?
Thanks,
As I said the problem is inconsistent. I believe it happens with unpublished pages, as I published the latter and it started working.
You can see it here for example:
We get an error TypeError: Cannot read properties of null (reading 'data') - and this is because the page returns as undefined and we access page.data.url
@adam, I opened the shared content which shows Unexpected Error: Something went wrong within the editor. Before proceeding further with debugging, just wanted to confirm if is this because of an undefined value or something else from your end?
Hi Garima,
Thanks for investigating. Please see the original message, it fails on page.data.url because the page is not found, which is the source of the problem we are trying to solve.
Actually, I managed to reproduce it in a CodeSandbox.
It’s very strange. If I fetch just the problematic page first (/product), and then another page (/pricing-plan) - both are returned as undefined.
But if I first fetch the pricing page, and then the product page - they are both returned successfully!
This is definitely a problem with the builder/react library. You can see it here: