Skip to content

Error: wp.Media is not a function (solved by disabling other plugins) #12492

Closed

Description

@LensflarePhoto

Activity

  1. swissspidy commented on Dec 1, 2018

    @swissspidy
    Member

    Which version of Gutenberg and WordPress are you using? Does this still happen with one of the default themes active?

    Does this happen when creating new posts or only when trying to edit existing ones?

  2. added
    Needs Testing
    on Dec 1, 2018
  3. designsimply commented on Dec 1, 2018

    @designsimply
    Member

    If you are using Gutenberg is a plugin, does the problem go away when you deactivate Gutenberg?

    I searched here and found two similar cases reporting the TypeError: wp.media is not a function error.

    In #9717, they solved the problem by switching to a different internet connection (which sounds strange and it's worth noting they also did a fresh install of WordPress prior to getting everything working).

    In #7643, they noted the same error appears when the Wordfence plugin is active. If you had a similar plugin that you deactivated for testing, did you also try clearing cache after doing that to make sure you've checked that change thoroughly?

  4. added
    [Status] Needs More Info
    and removed
    Needs Testing
    on Dec 1, 2018
  5. LensflarePhoto commented on Dec 3, 2018

    @LensflarePhoto
    Author

    Thanks for your help guys, after disabling all of my plugins one by one again, I cleared my cache in my browser and the issue has cleared now.

    For future reference, the issue was that basically couldn't load the Gutenberg plugin at all from the wp-admin portal, whether it be to edit an existing post/page or create a new one.

    Version of the Gutenberg plugin was 4.6.1 in Wordpress 4.9.8.

  6. designsimply commented on Dec 4, 2018

    @designsimply
    Member

    @LensflarePhoto thank you so much for the follow-up! If you happen to find out which plugin caused the trouble, please reply again and let me know so I can make a note of it in the title (which helps others in searches).

  7. added
    [Type] Help Request
    and removed
    [Status] Needs More Info
    on Dec 4, 2018
  8. changed the title [-]Error: wp.Media is not a function[/-] [+]Error: wp.Media is not a function (solved by disabling other plugins)[/+] on Dec 4, 2018
  9. afeiship commented on Mar 22, 2019

    @afeiship

    @designsimply Try this:

    import { removeFilter } from '@wordpress/hooks';
    
    removeFilter(
          'editor.MediaUpload',
          'core/edit-post/components/media-upload/replace-media-upload'
    );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Type] Help Request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions