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

CommentFileSizeAuthor
#5 3331649-5.patch667 bytesjrockowitz

Comments

solideogloria created an issue. See original summary.

solideogloria’s picture

Issue summary: View changes
jrockowitz’s picture

Status: Active » Closed (duplicate)
kyber’s picture

Hello. 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.)

jrockowitz’s picture

Status: Closed (duplicate) » Needs review
StatusFileSize
new667 bytes

@Kyber thank you for catching that mistake which needs to be fixed. I am not sure this will fix other related tippyjs problems.

solideogloria’s picture

I don't see any console errors when I use the patch.

solideogloria’s picture

I was hoping it'd also fix this issue I'm still having, but I guess not.

#3326597: Entity Select issues and PHP warning

kyber’s picture

Note, 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.

  • jrockowitz authored 522dc2ef on 6.2.x
    Issue #3331649 by jrockowitz: Libraries.yml looks in wrong folder for...
jrockowitz’s picture

Status: Needs review » Fixed
namscott’s picture

I manually applied the patch and still had to go in and change /dist/ to /6.x/ and add the .min did I miss something?

Status: Fixed » Closed (fixed)

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