2

I am using docker for my local webdev and am new to Craft CMS.

Currently I have a simple setup running, however, my Live-Preview does not seem to work and throws the "Template not found" error. Yet, when I surf to the same location in my browser all seems dandy and fine.

I'm sure I'm overlooking something simple, but can't seem to find it.

  • What might be adding to the problem is that I am running my container at localhost:8080 (instead of 80). I ran into another error when saving a new name for my website. It would not accept the current base url in my environment variable, localhost:8080 – Ignism Aug 22 at 16:01
2

I needed to set the base-url to @web in:

Settings > Websites > "your Website" > base-url 

This helps on my local docker-environment. Make sure, that your DEFAULT_SITE_URL="domain.something" is set in your .env file and that you are using the latest 3.2.x version.

  • Late reply, but that actually did the trick. – Ignism Sep 8 at 15:22
  • Cool, nice to hear :) – Marten Brosch Sep 9 at 17:53
1

Not sure how this would affect your docker set up, but this thread discourages the use of @web in your Base URL field.

As the thread and @marten-brosch suggested, set the DEFAULT_SITE_URL in your .env file and use this variable in the Base URL field in the CP. For me, the live preview wasn't working because my site is secured with SSL but my DEFAULT_SITE_URL wasn't prefixed with "https:"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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