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

Misleading error message when an image has an incorrect path #351

Open
ptgott opened this issue Jul 28, 2023 · 0 comments
Open

Misleading error message when an image has an incorrect path #351

ptgott opened this issue Jul 28, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@ptgott
Copy link
Contributor

ptgott commented Jul 28, 2023

Steps to reproduce:

  1. Create a file called docs/pages/test.png in a content directory within your gravitational/docs clone.
  2. Add the following content to the page:
 ---
 title: test
 description: test
 ---
 
 This is an image:
 
 ![my image](../fake.png)
  1. Start the dev server via yarn dev and navigate to localhost:3000/docs/test

  2. The error is:

    Error: Image with src "../fake.png" is missing required "width" property.
    

For a docs author who isn't familiar with this error, it can be difficult to debug. We should stat the file path of an image first to make sure it exists, and if not, show a more descriptive error.

@ptgott ptgott added the bug Something isn't working label Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant