I started the Server side JSX with React4XP - Enonic Developer Portal tutorial and stopped in the first render with the following error:
I checked the files and they have the same code as the tutorial
I started the Server side JSX with React4XP - Enonic Developer Portal tutorial and stopped in the first render with the following error:
@Espen42 Any ideas about this?
Hi, Marcelo
Have you tried setting the buildEnv variable as described in the section for
react4xp.properties => buildEnv as described here: React4XP - API reference - Enonic Developer Portal
Best wishes,
Bjørnar
Hi, Marcelo!
This is interesting. @bhj is on the right trail, but there should be a working fallback in the system for whenever buildEnv
is not used/found in react4xp.properties, so that shouldn’t be the problem. And the null
and undefined
parts of that message should be more useful, so it’s possible you’ve come across a bug.
Just to start by verifying some steps:
com.enonic.lib:lib-react4xp
? Following the starter, that probably looks like…include "com.enonic.lib:lib-react4xp:${rootProject.ext.LIB_REACT4XP_VERSION}"`
…where rootProject.ext.LIB_REACT4XP_VERSION
is set to 2.0.0 just above.def react4xpGradlePath = 'node_modules/react4xp/react4xp.gradle'
, and apply from: react4xpGradlePath
(or simply: apply from: 'node_modules/react4xp/react4xp.gradle'
?)If these are correct, we can continue looking for the problem more specifically.
Espen Norderud
Yes, I uncommented the line and tried to run the project again, but the error persisted.
Exactly. I have the same code from the tutorial up to the point of trying to render (Hello React - server and clientside rendering - Enonic Developer Portal). All the lines you mentioned are set up correctly in the project.
I reproduced it locally. Thanks for bringing it to our attention, I will look at it immediately and see if it’s a recently introduced bug in the react4xp library or something wrong in the guide.
Update: found and fixed the problem in lib-react4xp. I will test it further and release a bugfix update (probably version 2.0.1) for lib-react4xp and the starter.
In the meantime, I’ve uploaded it as a release candidate - version 2.0.1-RC1
. It will exist on our server until I release the finished 2.0.1, so you can try to update the lib-react4xp version to 2.0.1-RC1
in your build.gradle and proceed with the guide from there, and change it to 2.0.1
when that’s released.
Hope this helps!
-Espen
Here, the fix is released now: React4xp is updated: 2.0.1
Thank you for your support. It worked!