[wp-trac] [WordPress Trac] #62767: Featured image: media-models.min.js?ver=6.8-alpha-59568:2 Uncaught TypeError: t.get is not a function

WordPress Trac noreply at wordpress.org
Tue Jan 28 15:28:23 UTC 2025


#62767: Featured image: media-models.min.js?ver=6.8-alpha-59568:2 Uncaught
TypeError: t.get is not a function
------------------------------+-----------------------------------------
 Reporter:  nataliat2004      |       Owner:  (none)
     Type:  defect (bug)      |      Status:  new
 Priority:  normal            |   Milestone:  6.8
Component:  Media             |     Version:  trunk
 Severity:  normal            |  Resolution:
 Keywords:  has-testing-info  |     Focuses:  javascript, administration
------------------------------+-----------------------------------------

Comment (by siliconforks):

 I was able to reproduce the issue with a production build (created with
 `npm run build`).

 Some notes on reproducing this:
 * The bug seems to occur when images are being sorted, so you need to have
 at least two images in your media library to trigger it.
 * It does not appear to make any difference whether `WP_DEBUG` is true or
 false.
 * `SCRIPT_DEBUG`, on the other hand, does make a difference - make sure
 you do not have `SCRIPT_DEBUG` set to true, because that will cause
 unminified files to be used.  (By default `SCRIPT_DEBUG` is not set, so
 this should not be an issue unless you've previously added it to your `wp-
 config.php` file.)

 It seems like the cause of the issue was a change in version 3.18.0 of
 UglifyJS to "process input as ES module by default":

 https://github.com/mishoo/UglifyJS/releases/tag/v3.18.0

 In particular it appears to be `media-views.js` that is causing the issue
 - UglifyJS is assuming that it is an ES module, which causes UglifyJS to
 generate a faulty `media-views.min.js` file.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/62767#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list