Sitecore

Could not create controller with Constructor on type not found exception – Sitecore 8.2

When your controller rendering is failing with Could not create controller along with the inner exception,Constructor on type (your constructor name, e.g Sitecore.Feature.Controllers.MediaController)  not found, there is something wrong with the actual controller code. Could not create controller error has a few different reasons. Another common reason is the inner …

Sitecore

Program does not contain a static ‘Main’ method suitable for an entry point – Sitecore 8.2

When you set up a visual studio project for Sitecore, you need to set Output type to Class Library. If it is set to Windows Application or Console Application, you need to change it to Class Library. Otherwise you get a build error below. error CS5001: Program does not contain …

Sitecore

An unhandled exception occurred Rendering Controller Error – Sitecore 8.2

This error is an interesting one because there are a few different reasons. My case was not what the error actually says. Error in Experience Editor Error Rendering Controller: SitecoreDev.Feature.Media.Controllers.MediaController, SitecoreDev.Feature.Media. Action: HeroSlider: An unhandled exception occurred. at Sitecore.Mvc.Pipelines.MvcEvents.Exception.ShowAspNetErrorMessage.ShowErrorMessage(ExceptionContext exceptionContext, ExceptionArgs args) at Sitecore.Mvc.Pipelines.MvcEvents.Exception.ShowAspNetErrorMessage.Process(ExceptionArgs args) at (Object , Object[] ) …

Sitecore

Resolving Could not find configuration node for Core Database Error – Sitecore 8.2

Resolving Could not find configuration node for Core Database Error – Sitecore 8.2 Web.config file is minimal when you initially create ASP.NET project. When you install Sitecore, the config file is already in the web root folder and we don’t want to override it when publishing it first time. It …

Sitecore

Could not create controller Error for Controller Renderings – Sitecore 8.2

ASP.NET standard controller action routing is {controller}/{action} (see here). When you create a new project, you will see this in RouteConfig.cs file in the App_Start folder. Sitecore has overridden this standard route registration procedures. Routing to controller and action can be determined by the controller rendering component. This makes sense …

Sitecore

How to resolve Could not load file or assembly System.Web.Mvc Error – Sitecore 8.2

When I refactored an existing Sitecore 8.2 project into the Helix structure, I had a server error in ‘/’ application when I first tried to get into the sitecore admin console. This type of error is usually simple to fix. It means the version of dll in the bin folder …

Front-End

Getting Redux DevTools to Work with TypeScript

Redux DevTools is a chrome extension that enables developers to see Redux state change in the browser’s console. This post is a quick reference to set up your TypeScript react file so that you can debug your code with Redux DevTools. For normal JavaScript, it will be easy. You can …

Front-End

Adding CSS Support for TypeScript React

Let’s extend the previously build Webpack TypeScript React project to include CSS support. For a small application or widget, it is better to bundle CSS with JavaScript code. This post focuses on getting Bootstrap and styled-jsx working for a React project with TypeScript. Styled-jsx enables us to inject CSS style …

Front-End

Setting up Custom Webpack for TypeScript React

The easiest way to get started with React on TypeScript is to use create-react-app for TypeScript. As create-react-app uses webpack, you can eject config files by running npm run eject for further customisation. What about building the project and webpack config from scratch? It is sometimes good to give it …

Front-End

How to Set up React Test with Mocha and Enzyme for TypeScript

Enzyme is created by Airbnb for React component testing. You can easily test components’ output and it works with different testing frameworks like Mocha or Jest. This post focuses on setting up the test environment with Mocha for TypeScript. If you are used to JavaScript and fairly new to TypeScript, …