Skip to content
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

The plugin doesn't work in 2.0.2 #56

Open
josephmarkus opened this issue Jun 18, 2021 · 0 comments
Open

The plugin doesn't work in 2.0.2 #56

josephmarkus opened this issue Jun 18, 2021 · 0 comments

Comments

@josephmarkus
Copy link

josephmarkus commented Jun 18, 2021

Summary

Version 0.2.2 used to work ok ✅
Version 2.0.2 doesn't work at all ❌

Detail

In version 0.2.2 we noticed a couple of bugs:

Bug 1

Given the following data structure

blog
├── article-1
│   ├── index.md
│   └── header.jpg
└── article-2
    ├── index.md
    └── header.jpg

Loading article-1 may load header.jpg from article-2

The way around this?

Give unique names to images

For example

blog
├── article-1
│   ├── index.md
│   └── article-1-header.jpg
└── article-2
    ├── index.md
    └── article-2-header.jpg

Bug 2

Given the following image

images/in/some/folder/or/smth/3-secrets-to-relative-image-paths-plz-work.jpg

...has been moved to another location

images/in/some/new-folder/or/smth/3-secrets-to-relative-image-paths-plz-work.jpg

Would build in integration okay

...but then it would break in production with:

Failed to retrieve metadata from image /usr/src/app/www/images/in/some/folder/or/smth/3-secrets-to-relative-image-paths-plz-work.jpg

Notice that the path references the old image in folder and not the new image in new-folder (compare paths above)

So...

I thought I would bump the library to version 2.0.2 to fix the above issues, but now it won't work at all.

I created a small Gatsby Blog Starter repo that has steps to reproduce the issue:

https://github.com/josephmarkus/broken-gatsby-remark-relative-images

Screenshot 2021-06-18 at 09 30 35

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant