Skip to content

Stylesheet fetch error with external stylesheets #4503

@conwaydev

Description

@conwaydev

Bug Description

Enqueueing external stylesheets no longer works and I get a "Stylesheet fetch error" in the AMP validation:

Screen Shot 2020-04-01 at 5 36 29 PM

Expected Behaviour

If I revert #4404 the validation works as expected and my styles are available on the AMP version.

Steps to reproduce

  1. Set up AMP plugin in transition mode
  2. Enqueue external stylesheets inside of a functions.php:
add_action( 'wp_enqueue_scripts', function () {
	wp_enqueue_style( 'seedlings', 'https://cms.sproutsocial.com/wp-content/themes/sprout/css/seedlings-marketing.css' );
	wp_enqueue_style( 'seedlings-cdn', 'https://media.sproutsocial.com/assets/insights/css/seedlings-marketing-7ef5e60862.css' );
} );
  1. See the styles on the non-AMP versions
  2. Update a page and see there are AMP validation issues with an error code of STYLESHEET_FETCH_ERROR

Screenshots

Screen Recording 2020-04-01 at 05 42 PM

Screen Shot 2020-04-01 at 5 34 04 PM

With 182634c9363b897fe154c0f9db1b0f2b18fe88f5 reset:

Screen Recording 2020-04-01 at 05 45 PM

Additional context

  • WordPress version: 5.4
  • Plugin version: Version 1.6.0-alpha (Noticed on 1.5.1 on production)
  • Gutenberg plugin version (if applicable): n/a
  • AMP plugin template mode: n/a
  • PHP version: 7.3
  • OS: Linux (in a vagrant env)
  • Browser: [e.g. chrome, safari] n/a
  • Device: [e.g. iPhone6] n/a

Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

Implementation brief

QA testing instructions

Demo

Changelog entry

Metadata

Metadata

Assignees

Labels

BugSomething isn't workingCSSP0High priority

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions