Can't get React spa-sdk demo to work

I can’t get the React spa-sdk demo to work with a hippo 15.1.4 archetype

I’m trying to run the React spa-sdk/examples at main · bloomreach/spa-sdk · GitHub demo. I was not able to run it with Node 18.x
I could build and run it with Node 16.x

Here are my steps to reproduce the error.

I can successfully consume the CMS Delivery API by approaching it directly.
However, I cannot get the running instance of the demo-spa to consume the Delivery API, it results in a blank screen (see attached screenshot) and contains errors (…) Uncaught Error: Cannot find module ‘@bloomreach/react-sdk’).

Do others have the same problem while using this demo project or am I missing a step?

Thanks in advance.

Greetings,
Eric

Hi,

Thanks for your report. A colleague seems to have reproduced this and we have reported this to our engineering department. I don’t have anything more of substance to tell you right now, but we are looking into it.

Hi @erictheun,

The engines property in the package.json file in the root of the repository specifies that you need node 14 or 16 to run the repo. We simply have not tested it with node 18 yet.

I suggest to read the root README.md on how to work with the repository. For example you will need to run npm ci in the root and npm run build to build all the artifacts (or at least the react ones with npx lerna run build --scope @bloomreach/example-react --include-dependencies --stream) before you can start the example app.

I hope that helps.

Cheers,
Joeri

1 Like

Hi @jasper.floor , @Joeri_de_Gooijer ,

Thanks for your replies.

I executed your instructions and succesfully built and am able to run the react spa-sdk example.

Some suggestions:

  • add instruction in README.md to rename .env.dist file to .env
  • I was a bit confused which brxm cms demo content this spa-sdk can consume. Turns out it consumes the essentials generated (blog,news, etc) content which is great.
    Maybe describe explicitly in the root README.md which Essentials plugins have to be installed?
    It is unclear to me and so it results in this:

Greetings,
Eric

Hi @erictheun,
Thanks for the feedback, its always appreciated. We will definitely create a ticket mentioning to add your suggested changes and pick it up as soon as we are able to!