Troubleshooting Next.js template

I’ve been trying to get started with Sitecore headless development for a while now, and going through Sitecore’s getting started guide. I followed the steps without any issues, but when I ran up.ps1 the CM container failed to spin up. After a few tries of up and down cycles with the same issues I started to dig into the logs and found this error on the CM server

& : The term 'C:toolsentrypointsiisDevelopment.ps1' is not recognized as the 
name of a cmdlet, function, script file, or operable program. Check the 
spelling of the name, or if a path was included, verify that the path is 
correct and try again.
At line:1 char:3
+ & C:toolsentrypointsiisDevelopment.ps1
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:toolsentrypointsiisDevelopmen 
   t.ps1:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

To fix this I went to \run\sitecore-xp0\docker-compose.override.yml and updated the entry point from “& C:\tools\entrypoints\iis\Development.ps1” to “& C:\\tools\\entrypoints\\iis\\Development.ps1”

 cm:
    image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-xp0-cm:${VERSION:-latest}
    build:
      context: ../../docker/build/cm
      args:
        PARENT_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-xp0-cm:${SITECORE_VERSION}
        SOLUTION_IMAGE: ${REGISTRY}${COMPOSE_PROJECT_NAME}-solution:${VERSION:-latest}
        TOOLS_IMAGE: ${TOOLS_IMAGE}
        MANAGEMENT_SERVICES_IMAGE: ${MANAGEMENT_SERVICES_IMAGE}
        HEADLESS_SERVICES_IMAGE: ${HEADLESS_SERVICES_IMAGE}
    depends_on:
      - solution
    volumes:
      - ${LOCAL_DEPLOY_PATH}\platform:C:\deploy
      - ${LOCAL_DATA_PATH}\cm:C:\inetpub\wwwroot\App_Data\logs
      - ${HOST_LICENSE_FOLDER}:c:\license
    environment:
      SITECORE_LICENSE_LOCATION: c:\license\license.xml
      JSS_nexttest_DEPLOYMENT_SECRET: ${JSS_nexttest_DEPLOYMENT_SECRET}
      SITECORE_JSS_EDITING_SECRET: ${JSS_EDITING_SECRET}
      RENDERING_HOST_PUBLIC_URI: "https://${RENDERING_HOST}"
      ## Development Environment Optimizations
      SITECORE_DEVELOPMENT_PATCHES: DevEnvOn,CustomErrorsOff,HttpErrorsDetailed,DebugOn,DiagnosticsOff,InitMessagesOff,RobotDetectionOff
      Sitecore_AppSettings_exmEnabled:define: "no" # remove to turn on EXM
    entrypoint: powershell.exe -Command "& C:\\tools\\entrypoints\\iis\\Development.ps1"

After making that change, running a down command then up my Sitecore environment came up! I had some deserialization issues but that is for another blog post 🙂

Leave a Comment