Bloomreach reference spa Critical error

Hi,

I’ve started the “Content Developer Foundations - Content SaaS: On-demand - Partners” course on bloomreach academy, and i’ve followed all the steps in 1.6 Exercise 1.

After doing that exercise i proceeded and started doing 1.10 Exercise 2.

For some reason even after creating the channel and publishing the changes, the website still didn’t want to load.

I tried both http and https, and none of them worked, the exercice tells me to go to https://localhost:3000/ and that il have to ignore the error, but my browser doens’t allow the error to be ignored, i tried 4 browsers (Chrome, Firefox, Microsoft Edge, Opera) and nothing works, i also tried to allow the link in the settings and neither that worked!

https://localhost:3000, doens’t allow me to ignore the error

http://localhost:3000, is it not supposed to work? I really dont understand what i could’ve have done wrong…

Am I supposed to use SSL certificate on localhost? i doens’t seem that’s the case here since the solution doens’t say anything about it.

Did anyone have this problem while doing this course? And is anyone able to help me?

Thank you in advance :slight_smile:

Hey @SrMarcius ,

the frontend app should be running and accessed on HTTP not HTTPS.
We will verify the material but it should be http://localhost:3000/

The critical error visible on the second screenshot you have attached should be resolved after you have completed the 2nd exercise. If it is still present most likely the SPA isn’t configured correctly to communicate with the right Content SaaS instance so verify your .env file and the value for NEXT_PUBLIC_BRXM_ENDPOINT

Kind regards

I completed the second exercise, and the value on the env is the same as the tutorial: https://brx-content-trainingxx.bloomreach.io/delivery/site/v1/channels/brx-saas/pages, i changed the XX to the number of my training environment like the tutorial says, and I still have the error.

Any idea of what might be happening? Thanks :slight_smile:

Hey @SrMarcius ,

can you see any browser console errors or failing network calls when you access http://localhost:3000?
Also, can you verify manually that the Content SaaS delivery URL responds correctly?

Eg. try accessing from your browser https://brx-content-trainingxx.bloomreach.io/delivery/site/v1/channels/brx-saas/pages after replacing the XX with the appropriate number and see if you get the page delivery response and not " Whitelabel Error Page"

Kind regards

Hi,

This is what i see in my console, i tried to use error boundaries to check what was going on but somehow they are not working.

Screenshot 2024-04-19 095309

The Content SaaS delivery URL returns this:
image

I suppose the problem is with the url?

Thank you

Hey @SrMarcius ,

yes the issue is clearly in the backend.

If you see this error it is most likely because your homepage document is unpublished.
Can you verify if that is the case in the Content section of the CMS? Simply publishing it should resolve this.

Kind regards

I tried publishing it and nothing changed

Hey @SrMarcius ,

I’ve had a look into your instance and the issue is the channel name (you named the channel brXSaaS without space) so instead of
https://brx-content-trainingxx.bloomreach.io/delivery/site/v1/channels/brx-saas/pages
you should configure
https://brx-content-trainingxx.bloomreach.io/delivery/site/v1/channels/brxsaas/pages (without hyphen between brx and saas)
that second URL works as expected and should resolve your issue

Kind regards

Hi,

I changed the url and it works correctly now, but the error page is still appearing, i tried to publish the page again to see if it updates and it still didn’t work.

should i recreate a new channel?

No creating a new channel shouldn’t be necessary.

Check your browser console logs and networks calls again. Make sure that the new URL is actually being used. You can enable debug: true in the configuration object in the SPA to get logs about the behaviour of the SDK and which endpoint is being accessed.

Kind regards

Where can i find the SPA configuration object?

Hey @SrMarcius ,

in your spa where the BrPage component is used there is a configuration object being passed.
Inside that object you can set debug:true see also the SDK documentation page

Kind regards