question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot download media files in Drupal CMS

See original GitHub issue

Description

Cannot query field localFile on type media__image.

{
  image: field_media_image {
    localFile {
      childImageSharp {
        fluid(maxWidth: 475, maxHeight: 475) {
          ...GatsbyImageSharpFluid
        }
      }
    }
  }
}

Steps to reproduce

  1. In your Drupal Instance, install the Media module.
  2. Create and configure a new field field_media_image in Article, choose Media: Image.
  3. Create a new Article.
  4. Using Gatsby GraphQL Interface (GraphiQL), check if you can query localFile in field_media_image.

Expected result

Querying field localFile on type media__image, and downloading files.

Actual result

Cannot query field localFile on type media__image, and therefore no option to download files.

Environment

  System:
    OS: Linux 5.3 Ubuntu 18.04.4 LTS (Bionic Beaver)
    CPU: (4) x64 Intel(R) Core(TM) i5-4300U CPU @ 1.90GHz
    Shell: 4.4.20 - /bin/bash
  Binaries:
    Node: 14.0.0 - ~/.nvm/versions/node/v14.0.0/bin/node
    Yarn: 1.22.4 - ~/.nvm/versions/node/v14.0.0/bin/yarn
    npm: 6.14.4 - ~/.nvm/versions/node/v14.0.0/bin/npm
  Browsers:
    Chrome: 83.0.4103.61
    Firefox: 76.0.1
  npmPackages:
    gatsby: ^2.21.20 => 2.21.20
    gatsby-image: ^2.4.4 => 2.4.4
    gatsby-plugin-google-analytics: ^2.3.1 => 2.3.1
    gatsby-plugin-manifest: ^2.4.2 => 2.4.2
    gatsby-plugin-netlify: ^2.3.2 => 2.3.2
    gatsby-plugin-offline: ^3.2.1 => 3.2.1
    gatsby-plugin-react-helmet: ^3.3.1 => 3.3.1
    gatsby-plugin-sass: ^2.3.1 => 2.3.1
    gatsby-plugin-sharp: ^2.6.6 => 2.6.6
    gatsby-plugin-typography: ^2.5.2 => 2.5.2
    gatsby-source-drupal: ^3.5.1 => 3.5.1
    gatsby-source-filesystem: ^2.3.7 => 2.3.7
    gatsby-transformer-remark: ^2.8.7 => 2.8.7
    gatsby-transformer-sharp: ^2.5.2 => 2.5.2

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
TylerBarnescommented, May 29, 2020

Hi @boulaffasae !

Sorry to hear you’re running into an issue. To help us best begin debugging the underlying cause, it is incredibly helpful if you’re able to create a minimal reproduction. This is a simplified example of the issue that makes it clear and obvious what the issue is and how we can begin to debug it.

If you’re up for it, we’d very much appreciate if you could provide a minimal reproduction and we’ll be able to take another look.

Thanks for using Gatsby! 💜

0reactions
webdobecommented, May 18, 2021

Nvm… Everything works fine… I failed…

I had config: skipFileDownloads: true,

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot download files [#3221760]
Problem/Motivation This error is being presented in the browser console that does not allow downloading files. This says Google Chrome: ...
Read more >
Force Files to Download Instead of Showing Up in the ...
First, setup your file field so that it saves into a separate directory. This will make it so that you will only force...
Read more >
Upload images not working?
The first place to look if you are having problems with the Image module is your Drupal status page. Navigate to: Administer >>...
Read more >
Managing files and media | Features
To manage your website's uploaded files, go to Menu > Content, and then click the Files tab.
Read more >
Files are uploaded even when forms are not submitted
Make sure media module is enabled and go to /media/add, OR simply add a non-media file reference field to a content type and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found