Search code examples
phplaravellaravel-bladeamp-htmlmustache

Conflict between ( Laravel ) Blade template engine and AMP Mustache


Mustache template Engine is conflicting with Blade.

I am working on a php Laravelv 6.0 project which uses Blade as a template engine and i implement some AMP pages. When i use AMP mustache template inside a blade file, conflicts and displays the error below:

Uncaught TypeError: Cannot set property 'fill' of undefined

More info to this github issue: https://github.com/ampproject/amphtml/issues/29036


Solution

  • There is a fix for a similar bug and found it here -> Using Blade/Mustache templating mixing Laravel and Vue.Js ...

    add @ before {{value}}

    <template type="amp-mustache" id="amp-template-custom">
          <div>@{{category}}</div>
    </template>