prisma / docs

📚 Prisma Documentation
https://www.prisma.io/docs
Apache License 2.0
983 stars 777 forks source link

Updating an image locally (overwrite with a new version) does not update the image in the dev environment (`npm run dev`) #4412

Closed zachtil closed 1 year ago

zachtil commented 1 year ago

When you are working on screenshots locally, e.g. you create file named screenshot.png and add that to an MDX file with one of the image components:

and you then make changes to the screenshot in SnagIt and save, the image in the local dev environment at HTTP://localhost:8000 does not get updated.

For it to get updated, you have to stop npm run dev, run npm run clean and restart npm run dev. Only then can you see the updated version of the screenshot image.

Steps to reproduce

  1. WIth SnagIt (or any other screen capture that e.g. supports annotations), create a new screenshot with filename screenshot.png.
  2. Add the screenshot to an MDX file with either one of the image components.
  3. Make a change to the screenshot, e.g. add a new annotation, and save the screenshot (essentially overwriting the previous version of screenshot.png.
  4. Run the Prisma Docs local dev environment with npm run dev.

Result

When you open http://localhost:8000, you can see in the target HTML URL of the MDX file that the first version of the screenshot.png appears and not what you saved as the latest version.

The reason for this seems to be Gatsby's cache.

Expected result

When you save screenshot.png with new versions of the file, npm run dev is able to pick up the latest saved version without having to clean Gatbsy's local cache with npm run clean.

nilubava commented 1 year ago

The gatsby cache for plugins works in such a way that this becomes necessary.

nilubava commented 1 year ago

Create a Notion doc for this @nilubava @meletj

meletj commented 1 year ago

Process documented in Notion: https://www.notion.so/prismaio/Documentation-931269c0fa8d4068ba109852e11e693b#75b6951738c44528bd18284fa4b93d96