itsgoingd / clockwork

Clockwork - php dev tools in your browser - server-side component
https://underground.works/clockwork
MIT License
5.56k stars 320 forks source link

Clockwork Chrome Plugin Does Not Work with Docker (Lando) #634

Open lukastom opened 1 year ago

lukastom commented 1 year ago

I am using Lando for development (it is just an abstraction layer for Docker with docker-compose) on Linux Mint 21.1. In Lando/Docker containers, I have my Laravel project. I installed Clockwork via composer into my project, installed the Clockwork plugin in my Edge browser.

But it does not work in DevTools on the page of my Laravel project (e.g. https://laravel-blog.lndo.site/ in my case). So, I went to the Edge plugin settings and try to map the "Code path" like this:

  1. /app/blog/
  2. /home/lukas/Sites/Laravel-Blog/blog/

where 1. is the path in the container (in Docker that would typically be /var/www/html/, in Lando the apps sits in /app/ and 2. is the local path. Both paths are the folder, where is my Laravel app installed. Please, would someone know how to set it? Or how can I get any error or debugging information so I can find what the error is?

EDIT: I just did some other work for like 15 minutes, than went back and simply refreshed the page and the Edge plugin started to work. The problem is that I have no idea why, I did not do anything. Is there any lag or some cache got flushed or what?

itsgoingd commented 1 year ago

Hey, it should just work, with no additional Docker-specific setup required.

The "Code path" setting is only used for generating correct links for your text-editor in backtraces, it's entirely optional.

Braunson commented 11 months ago

I had this issue as well using Docker. The frontend is served on localhost:3000 and the Chrome plugin seems to see the calls to the backend but it forever shows "waiting" even though the call has been successfully returned (confirmed in the Network tab). Though if I go to the /clockwork endpoint it shows the calls (sometimes). Very weird.

JacquesvanWyk commented 3 months ago

I have same issue with DDEV. I also initially though the path in settings is issue but reading the comments seems now its just for code editor. Now sure how to debug

webmasterjedi commented 2 months ago

I was having this issue on DDEV and while troubleshooting I found this thread. I went back and decided to try a few things when I noticed this in a comment when publishing the clockwork.php config file via artisan: "Clockwork only runs on localhost, .local, .test and *.wip domains." I also noticed here: https://underground.works/clockwork/#docs-collected-data "Clockwork is only active when your app is in debug mode and running on a local domain - localhost, .local, .test, .wip and 127.0.0.1 - by default. " Also in the 5.2 changelog: "Running Clockwork is now restricted to local domains - localhost, local, test, wip and 127.0.0.1 - unless explicitly enabled. If you want to use Clockwork on a different domain, please explicitly enable it by setting CLOCKWORK_ENABLE to true."

Since DDEV and Lando use a different URL when developing I decided to explicitly set CLOCKWORK_ENABLE=true in my .env and it fixed the issue for me. I believe the fix here is adjust lando/ddev to use a .local/test/wip TLD or just set the environment flag.