Closed Beatusvir closed 7 years ago
It looks like your controller has not been registered with the IoC container. If you are on 8.2+ you need to make sure that all controllers are registered with the container using a configurator class. See this post for more details on that: https://kamsar.net/index.php/2016/08/Dependency-Injection-in-Sitecore-8-2/
Thanks for your quick reply @GuitarRich , I'm more a react guy than a sitecore guy, and Sitecore is huge!!, checking it
@Beatusvir did you get this sorted?
@GuitarRich hey Richard, I started fresh from a new Habitat instance to make sure I wasnt doing something weird and this error is gone. Still couldnt get the controller to render my react component. I'll post the new question soon.
PS: off topic, I'm from Venezuela, last few weeks were crazy here so I had to run to Panama for a few days to see how everything would come out and just got home, so I can resume work for a now at least
Edit 2: So I finally got this to render; I had to edit the views/index.js (where we export every component) to this (not the .default at the end):
~~Edit: Ok some progress, right now I'm getting this: Minified error~~
~~Alright, I was able to try this again. I deleted my rendering and created a new one, copied the jsx file to the website folder (not sure if its needed since the script is already on place) and the error is now this:~~
Message: The model item passed into the dictionary is of type *** but this dictionary requires a model item of type 'Sitecore.Mvc.Presentation.RenderingModel'.
hmm... it looks like is trying to render the cshtml view, like the normal view I'm currently using, same name
Hey guys
I'm trying to get this working, after creating a React Controller Rendering and setting the jsx file / controller setting. I add the rendering to a page and I get this:
The controller is just this, I guess the problem is from
PageTitle
rendering name; thats what I was doing following the thisThis is the sitecore rendering