-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gatsby-remark-images not working (gatsby v2) #6698
Comments
You need to use the v2 versions of the plugins. The migration guide explains that |
@LekoArts thanks for reply. I have go through every npm packages that I had and update them, now my dependencies are: "dependencies": {
"gatsby": "^2.0.0-beta.56",
"gatsby-plugin-catch-links": "^1.0.24",
"gatsby-plugin-react-helmet": "^3.0.0-beta.4",
"gatsby-plugin-sharp": "^2.0.0-beta.7",
"gatsby-remark-images": "^2.0.1-beta.9",
"gatsby-source-filesystem": "^2.0.1-beta.9",
"gatsby-transformer-remark": "^2.1.1-beta.4",
"react": "^16.4.1",
"react-dom": "^16.4.1",
"react-helmet": "^5.2.0"
} Is there anything I need to take note when using latest packages related to my problem above? Because the problem still persists. I have double check the config file at branchv2 at gatsby-starter-blog This is my gatsby-config.js plugins: [
'gatsby-plugin-react-helmet',
'gatsby-plugin-catch-links',
'gatsby-plugin-sharp',
{
resolve: 'gatsby-source-filesystem',
options: {
path: `${__dirname}/src/pages`,
name: 'pages',
},
},
{
resolve: `gatsby-transformer-remark`,
options: {
plugins: [
{
resolve: `gatsby-remark-images`,
options: {
// It's important to specify the maxWidth (in pixels) of
// the content container as this plugin uses this as the
// base for generating different widths of each image.
maxWidth: 700,
},
},
],
},
},
], Is there any place where I can look for regarding the syntax changes for specific plugins at Gatsby? Also, is there any additional packages / plugins required for this to work? |
I can confirm that |
Not sure if it affects my case, but to follow suit I followed gatsby-config.js@v2 to install But, no luck. still not working. ps: gatsby-transformer-sharp I installed is version |
Just an update, I tried the canary tag which worked then tried the next tag again and responsive images are now being inserted into the HTML on a production build. Must have been a cache or module version issue. @khmy2010 Worth noting that you don't see the output in development (e.g. |
Try deleting your node_modules and .cache folder and reinstalling the packages. Can you provide a sample repo? |
Hi @LekoArts, I have deleted my node_modules and .cache folder and reinstall the package by running No luck, nothing works. |
Thanks for the detailed report @khmy2010 - there's nothing that looks obviously wrong above. Or you could try checking out the Gatsby repo and running the There's a page there that demos using images: https://using-remark.gatsbyjs.org/responsive-images-and-iframes/ Then work back from there and see if there's any differences in the example project vs your project. |
Hi, I have similar issue. If I get I've got the example repo @m-allanson pointed at, the same, doesn't work, but when I deployed it to Netlify it works Any idea what's the problem, my localhost is
When I started with gatsby v1 I had some problems to make ps: @khmy2010 Could you please check if deploying resolves your issue too? |
I spent a bit of time digging into this and there sure seems to be something odd going on... It seems like @greglobinski hmm that's interesting that your site works on netlify but not locally. |
If anyone has the time to investigate further, there's a new debugging guide that may be useful https://next.gatsbyjs.org/docs/debugging-the-build-process/ |
I don't know why, but I know that if one of these is higher than versions below, the Till these versions images are generated as they should Update: |
This bug is not related to the |
This might be the relevent commit: f0ef8b2 |
Fixed in #6792 Thanks @giraffesyo! |
I actually stumbled into this case again, and it seems that only by applying @martin-css solution of adding |
I got the same issue again as well. |
fixes some images not being processed as of gatsbyjs/gatsby#6698
fixes some images not being processed as of gatsbyjs/gatsby#6698
I also ran into the same issue. What is more weird is that 22 out of 69 images are processed. All of these processed images work fine (the src of parsed img in the markdown is correctly set, and the images of different versions are placed in the destination folder), whereas the rest of pictures and their respective imgs in the markdown remain unprocessed. The images that are processed seem determined and not random. I have also found that in the GraphiQL, querying images with the following GraphQL query will yield all the 69 images, including those that are not processed. allImageSharp {
nodes {
id
}
} What is more important is once the src of the pictures are queried (for example using the following query), the process of the rest of images will start, and the thumbnails will be created. The markdown will remain unchanged, though. query MyQuery {
allImageSharp {
nodes {
id
sizes {
src
}
}
}
} Currently I have to use the package.json "gatsby": "~2.13.15",
"gatsby-plugin-sharp": "~2.2.4",
"gatsby-remark-images": "~3.1.4",
"gatsby-transformer-remark": "~2.6.3",
"gatsby-transformer-sharp": "~2.2.2", |
I've just come across this, suffering the same issue. I am running Gatsby 2.18.6 and gatsby-transformer-remark ^2.6.38. I have tried most of the things listed under this issue as well as a few other similar ones stating the same problem, but to no avail. Clearing However, I tried downgrading gatsby-transformer-remark to 2.1.1-beta.3 as mentioned by @greglobinski. Initially this didn't do anything, but I then found that changing file extensions from This is definitely odd and not a solution I would have expected to have worked but for some reason it does. tl;dr - gatsby-transformer-remark @ 2.1.1-beta.3 and change the file extension of affected images from |
Came across this today... after about 30 mins, I just did uninstall and reinstall on ‘gatsby-transformer-remark’ small minor bump on the version and then it just works as expected. |
I came across this issue today. Here is what I've noticed:
I noticed that the broken image wasn't available at the above path. For whatever reason, Clearing cache, uninstalling and installing all the related plugins did nothing for me. But somehow I accidentally made it work by doing a hard refresh ( Give that a try. You won't get those 30 minutes back. |
Came across this issue today with gatsby v4. My problem was that the What worked for me was to change the images (both the image and the inline markdown) with |
changing file extension is work for me |
I'm experiencing this today, latest Gatsby and all that. Found that if I set |
Screenshot for 1 and 2
I have double check my markdown to ensure it points to the correct file:
![Chinese Salty Egg](./fanfan.jpg)
The version of my gatsby-remark-images and gatsby-plugin-sharp are 1.5.67 and 1.6.48 respectively.
I have double checked the documentations on Gatsby V1 and Gatsby V2
After all this, the images are still not showing.
Screenshot 2: the images does not show up in the web page
Screenshot 3: gatsby-remark-images is not even doing the work
My environment:
I have read the following before I came to this point:
Gatsby Starter Blog V2 Example
Example on how to insert images into markdown
Everything appears normal during compiling:
Please enlighten me on this issue, thanks.
The text was updated successfully, but these errors were encountered: