Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LiveComponent] Cannot find a template, cache may be corrupt #2635

Open
aleho opened this issue Mar 13, 2025 · 3 comments
Open

[LiveComponent] Cannot find a template, cache may be corrupt #2635

aleho opened this issue Mar 13, 2025 · 3 comments
Labels

Comments

@aleho
Copy link
Contributor

aleho commented Mar 13, 2025

Recently I've been getting more and more errors with live components that are being loaded with lazy or defer in production.

I cannot reproduce it reliably in dev, though I've seen it happen too, but it's reported in multiple projects in production and so far always a live component.

The errors all read something like Uncaught PHP Exception RuntimeException: "Cannot find a template matching "072068688c73461b3e628c8634ef3c51". Cache may be corrupt." at TemplateMap.php line 36".

I've tried to find out what's happening, but I really don't know where to start (given it's hard to reproduce).

Please let me know how I can help to debug this.


This would be the payload for the request that triggers the error above (it's basically an image tag with a signed Google Maps image src):

{
  "props": {
    "link": true,
    "zoom": 13,
    "width": 640,
    "height": 360,
    "scale": 2,
    "markers": [
      [
        "color:#5191AA",
        "label:F",
        "48.144859,16.297634"
      ]
    ],
    "address": null,
    "latitude": "48.144859",
    "longitude": "16.297634",
    "color": "color-primary-500",
    "@attributes": {
      "id": "live-236830884-0",
      "data-host-template": "072068688c73461b3e628c8634ef3c51",
      "data-embedded-template-index": 2368308841,
      "class": "block rounded-md mb-12",
      "img:class": "w-full rounded-md"
    },
    "@checksum": "NGqFvn37BrGIh4jaJErjcwjkpFEjQaMsy0tk0NcJSpk="
  },
  "updated": {}
}
@aleho aleho added the Bug Bug Fix label Mar 13, 2025
@smnandre
Copy link
Member

I've seen this happen in one situation: the production cache rebuilt (var/build/prod or var/cache/prod).

Do you have frequent deployments ?

@aleho
Copy link
Contributor Author

aleho commented Mar 14, 2025

I've seen it after a deployment and attributed it to browser cache, but days afterwards in another project.

Come to think of it (caching) again, I think these were two problems. One of them because of a deployment.

The other because of "if-none-match" after a deployment and JS requesting "invalid " data.

Are live components supposed to survive a deployment if the page has been committed to the browser cache? Or is this a design limitation?

@aleho
Copy link
Contributor Author

aleho commented Mar 17, 2025

After my last comment I've seen the error again and again without any deploys in the meantime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants