You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When pushing code to PRODUCTION this error happens whenever I try to display a Map:
craft\web\View::registerScript(): Argument #1 ($script) must be of type string, null given, called in /home/craft/www.domain.com/vendor/craftcms/cms/src/services/TemplateCaches.php on line 323
The code works as it should in DEV.
If I just switch my environment to "production" in my dev area the same error appears.
Additional info
Craft version: Craft CMS 5.5.4
Maps version: 5.0.4
PHP version: 8.2
The text was updated successfully, but these errors were encountered:
So the issue is with Crafts cache tag. If you wrap code within the cache tag (and not the entire full page) the scripts injected by the tag will not be registered (since Craft is outputting cached content and not injecting the embeded map field).
Is there a workaround for this? Like injecting the script code inline in the HTML or similar?
For now I've wrapped all my map fields in iframes with a custom route so a blank un-cached page that just displayes the map. If anyone runs in the same issue. Like this:
Description
When pushing code to PRODUCTION this error happens whenever I try to display a Map:
craft\web\View::registerScript(): Argument #1 ($script) must be of type string, null given, called in /home/craft/www.domain.com/vendor/craftcms/cms/src/services/TemplateCaches.php on line 323
The code works as it should in DEV.
If I just switch my environment to "production" in my dev area the same error appears.
Additional info
The text was updated successfully, but these errors were encountered: