Skip to content

Server side rendering breaks validation (amp4ads) #496

Open
@jcastilloa

Description

@jcastilloa

SSR is breaking the page validation due !important declaration included in amp-ad-0.1.js:

<style amp-runtime="" i-amphtml-version="012202042210001">html{overflow-x:hidden!important}html.i-amphtml-fie{height:100%!important;width:100%!important}html:not([amp4ads]),html:not([amp4ads]) body{height:auto!important}html:not([amp4ads]) body{margin:0!important}body{-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;-ms-text-size-adjust:100%;text-size-adjust:100%}html.i-amphtml-singledoc.i-amphtml-embedded{-ms-touch-action:pan-y ... </style>

I've tried removing AmpRuntimeCss:

$configurationData = [
            Configuration::KEY_TRANSFORMERS => [
                Transformer\AmpBoilerplate::class,
                Transformer\ServerSideRendering::class,
                Transformer\ReorderHead::class,
                Transformer\OptimizeHeroImages::class,
                Transformer\TransformedIdentifier::class,
            ],
        ];

$transformationEngine = new TransformationEngine(new DefaultConfiguration($configurationData), $cachedRemoteRequest);

But empty tag was generated:

<style amp-runtime=""></style>

And it breaks the validation again.

Regards.

Metadata

Metadata

Assignees

Labels

BlockedCannot be worked because of upstream reasons

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions