I ran into a surprising fatal error when enabling the CSP module:

Drupal\Core\Asset\Exception\IncompleteLibraryDefinitionException: Incomplete library definition for definition 'php-markdown' in extension 'markdown' in Drupal\Core\Asset\LibraryDiscoveryParser->buildByExtension() (line 91 of E:\Web\Ambient.Impact\Web\drupal\core\lib\Drupal\Core\Asset\LibraryDiscoveryParser.php).

I don't know why the CSP module is triggering this, but after taking a look at markdown.libraries.yml, I'm guessing that the php: keys are the problem because changing them to a presumably valid js: fixes the error. Note that I'm using Composer, so I don't think the module is using the library definitions in this file for me, but this may break for anyone having manually installed it. I figured I should share this in case anyone else runs into this. I believe the file is supposed to be removed in 8.x-2.x, so that should also fix it whenever that happens. Feel free to close this, maintainers.

Comments

Ambient.Impact created an issue. See original summary.

markhalliwell’s picture

Title: Fatal error due to invalid markdown.libraries.yml when enabling CSP module » Remove antiquated 3rd party library installation methods
Version: 8.x-1.x-dev » 8.x-2.x-dev
Category: Bug report » Task
Priority: Minor » Normal

All libraries should be installed via Composer.

See #2898331-22: Needs better documentation on how to add external PHP library for further information.

markhalliwell’s picture

Status: Active » Fixed
Ambient.Impact’s picture

Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.