External libraries causing an unexpected error.

Created on 9 November 2022, almost 2 years ago
Updated 13 September 2023, about 1 year ago

Problem/Motivation

When trying to access a page with a view using the "Full Calendar Display" plugin, if the interface translation is enabled in the site, it crashes with the following message "The website encountered an unexpected error. Please try again later.".

The error that causes this is:
"Exception: Only local files should be passed to _locale_parse_js_file(). in _locale_parse_js_file() (line 1110 of core/modules/locale/locale.module)."

Steps to reproduce

Confirm that the module Interface translation (locale) is enabled.
Create a view page using the Full Calendar Display.
Visit the view page.

Proposed resolution

The external libraries in fullcalendar_view.libraries.yml should be declared to be external by specifying "type: external".

🐛 Bug report
Status

Fixed

Version

5.1

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇦🇺Australia mingsong 🇦🇺

    It is not necessary always external libraries.

    In a situation that the required libraries are download and host on the local, the libraries are not external.

  • Status changed to Active about 1 year ago
  • 🇨🇭Switzerland berdir Switzerland

    The problem isn't that they are external. The problem is that they are not *defined* as external, so locale.module gets confused about them, it expects a local file.

    An external file must have type: external in the definition, so your code that switches the library needs to add that.

    Example:

    '//cdn.jsdelivr.net/gh/davidjbradshaw/iframe-resizer@v4.2.10/js/iframeResizer.contentWindow.min.js': { type: external, minified: true }
    
  • Status changed to Needs review about 1 year ago
  • 🇨🇭Switzerland berdir Switzerland

    Here is a patch that adds the type.

    • Berdir authored b375389a on 5.x
      Issue #3320044 by Berdir, Carlos Marco, Mingsong: External libraries...
  • Status changed to Fixed about 1 year ago
  • 🇦🇺Australia mingsong 🇦🇺

    Thanks everyone.

    The patch is simple and should be safe.

    Pushed to the develop branch.

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

Production build 0.71.5 2024