putyourlightson / craft-blitz

Intelligent static page caching for creating lightning-fast sites with Craft CMS.
https://putyourlightson.com/plugins/blitz
Other
149 stars 36 forks source link

Twig Runtime Error in Diagnostics Utility #716

Closed MattWilcox closed 2 weeks ago

MattWilcox commented 2 weeks ago

Bug Report

Utilities > Blitz Diagnostics > [X] Tracked Pages > [page] > Entry Queries

Results in the below

Screenshot 2024-10-07 at 15 36 57

(I'm trying to track down why one specific Entry in Blitz seems to be tracking two other Entries that - as far as I can see - should have nothing to do with the Entry being cached).

Screenshot 2024-10-07 at 15 37 21

Diagnostics Report

Application Info

Installed Plugins

Loaded Modules

Blitz Plugin Settings

{
    "debug": true,
    "hintsEnabled": true,
    "cachingEnabled": true,
    "refreshCacheEnabled": true,
    "refreshMode": 2,
    "includedUriPatterns": [
        {
            "siteId": 1,
            "uriPattern": ".*",
            "enabled": true
        },
        {
            "siteId": 2,
            "uriPattern": ".*",
            "enabled": true
        }
    ],
    "excludedUriPatterns": [
        {
            "siteId": 1,
            "uriPattern": "saved-entries",
            "enabled": true
        },
        {
            "siteId": 1,
            "uriPattern": "customer\/*",
            "enabled": true
        },
        {
            "siteId": 1,
            "uriPattern": "online-store\/basket",
            "enabled": true
        },
        {
            "siteId": 1,
            "uriPattern": "online-store\/checkout\/*",
            "enabled": true
        },
        {
            "siteId": 2,
            "uriPattern": "saved-entries",
            "enabled": true
        },
        {
            "siteId": 2,
            "uriPattern": "customer\/*",
            "enabled": true
        },
        {
            "siteId": 2,
            "uriPattern": "online-store\/basket",
            "enabled": true
        },
        {
            "siteId": 2,
            "uriPattern": "online-store\/checkout\/*",
            "enabled": true
        }
    ],
    "cacheStorageType": "putyourlightson\\blitz\\drivers\\storage\\FileStorage",
    "cacheStorageSettings": [],
    "cacheStorageTypes": [],
    "cacheGeneratorType": "putyourlightson\\blitz\\drivers\\generators\\HttpGenerator",
    "cacheGeneratorSettings": [],
    "cacheGeneratorTypes": [],
    "customSiteUris": [],
    "cachePurgerType": "putyourlightson\\blitz\\drivers\\purgers\\DummyPurger",
    "cachePurgerSettings": [],
    "cachePurgerTypes": [],
    "deployerType": "putyourlightson\\blitz\\drivers\\deployers\\DummyDeployer",
    "deployerSettings": [],
    "deployerTypes": [],
    "ssiEnabled": true,
    "ssiTagFormat": "<!--#include virtual=\"{uri}\" -->",
    "detectSsiEnabled": true,
    "esiEnabled": false,
    "onlyCacheLowercaseUris": false,
    "queryStringCaching": 0,
    "includedQueryStringParams": [
        {
            "enabled": true,
            "siteId": "",
            "queryStringParam": ".*"
        }
    ],
    "excludedQueryStringParams": [
        {
            "enabled": true,
            "siteId": "",
            "queryStringParam": "gclid"
        },
        {
            "enabled": true,
            "siteId": "",
            "queryStringParam": "fbclid"
        }
    ],
    "apiKey": "",
    "generatePagesWithQueryStringParams": true,
    "purgeAssetImagesWhenChanged": true,
    "refreshCacheAutomaticallyForGlobals": false,
    "refreshCacheWhenElementMovedInStructure": true,
    "refreshCacheWhenElementSavedUnchanged": false,
    "refreshCacheWhenElementSavedNotLive": false,
    "cacheNonHtmlResponses": false,
    "trackElements": true,
    "trackElementQueries": true,
    "excludedTrackedElementQueryParams": [],
    "cacheDuration": null,
    "nonCacheableElementTypes": [],
    "sourceIdAttributes": [],
    "liveStatuses": [],
    "integrations": [
        "putyourlightson\\blitz\\drivers\\integrations\\CommerceIntegration",
        "putyourlightson\\blitz\\drivers\\integrations\\SeomaticIntegration"
    ],
    "defaultCacheControlHeader": "no-store",
    "cacheControlHeader": "public, s-maxage=31536000, max-age=0",
    "cacheControlHeaderExpired": "public, s-maxage=5, max-age=0",
    "sendPoweredByHeader": true,
    "outputComments": true,
    "refreshCacheJobPriority": 10,
    "driverJobBatchSize": 100,
    "driverJobPriority": 100,
    "queueJobTtr": 300,
    "maxRetryAttempts": 10,
    "maxUriLength": 255,
    "mutexTimeout": 1,
    "commands": [],
    "injectScriptEvent": "DOMContentLoaded",
    "injectScriptPosition": 3
}

Recommendations

Site Tracking [1]

Site Tracking [2]

bencroker commented 2 weeks ago

Thanks for reporting that. It does indeed look like a bug. I’ll work on a fix and let you know when it is ready.

bencroker commented 2 weeks ago

Fixed in https://github.com/putyourlightson/craft-blitz/commit/e6f90b18db8f9d7c53e5d3e1dfff736052ca8889 for the next release. In the meantime, turning off devMode should allow you to view the page without getting the Twig runtime error.

MattWilcox commented 2 weeks ago

That was fast! Thanks Ben :)

bencroker commented 4 days ago

Released in 5.9.1. Thanks again for reporting!