5

Recently we moved from code-first to Sitecore-first approach. After deploying the react and sitecore in Sitecore-first mode, we can't see the renderings on the page.

Getting below error

"JSS Component is missing React implementation. See the developer console for more information"

Console has below message

Placeholder page-content contains unknown component. Ensure that a React component exists for it, and that it is registered in your componentFactory.js.

enter image description here

4
  • Did you deploy your app? Aug 5, 2020 at 15:04
  • yes i used jss deploy files command to push react build files
    – Rishi
    Aug 5, 2020 at 15:29
  • Could you make sure that that the component name in a rendering item and component name in react app are the same Aug 6, 2020 at 6:21
  • Have you created JSS build in the connected mode and deployed inside the Sitecore website. Component name should match in both places
    – AlokBhatt
    Aug 6, 2020 at 10:55

2 Answers 2

5

This error occurs when the Renderings defined in Sitecore and the components defined in the JSS app do not match.

Rishi - You said you deployed using jss deploy files - this command deploys the JS bundle, but does not create any Sitecore items.

When switching from Code-First to Sitecore-First, it is recommended to use jss deploy app to ensure that files, and Sitecore items (template, rendering definitions) get imported. If you need to import content too, then use jss deploy app -c

When the import runs, pay attention to the output in the terminal. Make sure there are no errors.

If the above steps were followed and you are still seeing this error, check the following:

  • Check that all your JavaScript component names and your Sitecore rendering names match exactly (see src/boot/componentFactory.js for exported JS component names)
  • After a deploy, check the timestamp of the JS bundle in <SitecoreRoot>/dist/appName to verify that it's actually getting deployed. If it's not, verify that the values in your scjssconfig.js and your JSS XML configs (Sitecore path, API path, deployment secret etc) are as expected.
1

The root cause of this can be multiple:

  • Check the rendering and component name mentioned over there. Component name should match with the name mentioned in the rendering and componentFactory file in case of ReactJS
  • In case of Sitecore first, either reactJS deployment has not done yet or component name not matching with the name mentioned in the rendering.

Hoping this will help!.

Thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.