Problem/Motivation
webform.libraries.yml
cdn:
/libraries/tippyjs/dist/: https://unpkg.com/tippy.js@6.2.6/dist/
js:
/libraries/tippyjs/dist/tippy-bundle.umd.js: { }
However, the library actually gets installed into libraries/tippyjs/6.x/, and it's tippy-bundle.umd.min.js, not tippy-bundle.umd.js
Steps to reproduce
When I go to add an element to a new webform, such an Entity Select, I see this in the browser console:
Refused to execute script from 'https://example.ddev.site/libraries/tippyjs/dist/tippy-bundle.umd.js?v=6...' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
Looking at the sources tab, or the project directory, shows that the file is located at <code>libraries/tippyjs/6.x/tippy-bundle.umd.min.js
I installed the libraries by including the libraries composer file.
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Comments
Comment #2
solideogloria commentedComment #3
jrockowitz commented@see #3331106: popper.js library missing in composer.libraries.json
Comment #4
kyber commentedHello. We just encountered this issue in beta6. In grepping for use of tippy in webforms I noticed some inconsistent versioning.
composer.libraries.json: "url": "https://registry.npmjs.org/tippy.js/-/tippy.js-6.3.7.tgz",
src/WebformLibrariesManager.php: 'download_url' => Url::fromUri('https://registry.npmjs.org/tippy.js/-/tippy.js-6.3.7.tgz'),
webform.libraries.yml: /libraries/tippyjs/dist/: https://unpkg.com/tippy.js@6.2.6/dist/
(also, popper.js seems to not have been downloaded and is being fetched remotely from unpkg directly in the browser, causing occasional browser blocks - not sure if that is related. investigating both.)
Comment #5
jrockowitz commented@Kyber thank you for catching that mistake which needs to be fixed. I am not sure this will fix other related tippyjs problems.
Comment #6
solideogloria commentedI don't see any console errors when I use the patch.
Comment #7
solideogloria commentedI was hoping it'd also fix this issue I'm still having, but I guess not.
#3326597: Entity Select issues and PHP warning
Comment #8
kyber commentedNote, this site was not using composer, but I see you do your own JS fetches anyway so I don't see why it should matter.
I'll doublecheck what's going on with tippy and popper.
Worst case, I just specify the correct paths, manually fetch, or add a ludwig config.
Comment #10
jrockowitz commentedComment #11
namscott commentedI manually applied the patch and still had to go in and change /dist/ to /6.x/ and add the .min did I miss something?