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

markdown image reference can not find file in docs/assets -> 404 #600

Closed
alex254 opened this issue Apr 24, 2018 · 10 comments
Closed

markdown image reference can not find file in docs/assets -> 404 #600

alex254 opened this issue Apr 24, 2018 · 10 comments
Assignees
Labels
bug An error in the Docusaurus core causing instability or issues with its execution status: claimed Issue has been claimed by a contributor who plans to work on it.

Comments

@alex254
Copy link

alex254 commented Apr 24, 2018

Is this a bug report?

yes

Have you read the Contributing Guidelines on issues?

yes

Environment

(OS, Node, npm, yarn)
Windows 10
Node v8.11.1
npm 5.6.0
yarn 1.6.0

Steps to Reproduce

(Write your steps here:)
I ran into the problem a bit further down my own project; but initiated a new docusaurus project from the start to see if the problem still exists. And I get the same error...no changes were made to siteConfig.js

  1. npm install --global docusaurus-init
  2. docusaurus-init
  3. rename examples -> /docs and /blog as in installation manual
  4. add folder /assets to /docs
  5. add a dummy dosomething.png (also .jpg) file to assets folder
  6. add ![test](assets/dosomething.png) to doc1.md
  7. npm start
  8. console error: GET http://localhost:3000/docs/assets/dosomething.png 404 (Not Found)

tried it in Chrome and Brave browser; same result.

Expected Behavior

Expected: image is shown in browser

Actual Behavior

console error: GET http://localhost:3000/docs/assets/dosomething.png 404 (Not Found)

Reproducible Demo

https://github.com/iam-io/documentation/blob/master/docs/DOC_2_shoppable.md

Here you can see that github understand the link and shows the picture...however my npm build doesn't work.

@JoelMarcey JoelMarcey added the status: needs more information There is not enough information to take action on the issue. label Apr 24, 2018
@JoelMarcey
Copy link
Contributor

JoelMarcey commented Apr 24, 2018

Hi @alex254. Interesting, I assume you are using the latest version of Docusaurus (1.0.14 - which you can check by doing npm outdated docusaurus from the website directory).

I just tried this on OS X, and it worked fine.

So I am now led to believe that this may be a Windows support problem on our part.

What happens if you put the image in website/static/img and reference the image in markdown like

![test](/img/dosomething.png)

@JoelMarcey
Copy link
Contributor

Or if you have a way to try your test on a Mac or Linux machine, that could be another way to verify as well.

@alex254
Copy link
Author

alex254 commented Apr 24, 2018

Hi JoelMarcey,

Thanks for the super fast response :)

It works when I put the files in website/static/img and reference them like you proposed :)

ehm, I get an empty response if I run the version check...npm update docusaurus also gives an empty response...I guess it's up to date

I don't have a Mac or running Linux sorry..

@alex254
Copy link
Author

alex254 commented Apr 24, 2018

I have tried:

assets/dosomething.png
/assets/dosomething.png
docs/assets/dosomething.png
/docs/assets/dosomething.png

none of them work, so I am starting to think it genuinely is a bug; also considering it that does work when I put them website/static/img folder

@JoelMarcey
Copy link
Contributor

@alex254 It is probably a bug with how we handle paths specifically for Windows, although I thought we fixed a bunch of that. I need to get my hands on a Windows machine to test. But that is my current working theory.

@alex254
Copy link
Author

alex254 commented Apr 25, 2018

@JoelMarcey Ok, I'm going to continue with my project; thanks for the help! If you want to get the reproducable demo please use this commit: https://github.com/iam-io/documentation/commit/10d5f232d0889f20e658e01202b8b54fa6af49ec

@RemyLespagnol
Copy link
Contributor

Same issue on our project. @JoelMarcey will you still look at this ?

@endiliey
Copy link
Contributor

endiliey commented Jun 1, 2018

This is related to Windows.

Tried on Linux
linux

Tried on Windows
windows

@endiliey endiliey added platform-inconsistency and removed status: needs more information There is not enough information to take action on the issue. labels Jun 1, 2018
@endiliey endiliey self-assigned this Jun 2, 2018
@endiliey endiliey added the status: claimed Issue has been claimed by a contributor who plans to work on it. label Jun 2, 2018
@endiliey endiliey added the bug An error in the Docusaurus core causing instability or issues with its execution label Jun 2, 2018
@endiliey
Copy link
Contributor

endiliey commented Jun 2, 2018

@Themandunord @alex254 appreciate it if you could test out #720 and see if it's working for you

@endiliey endiliey added fixready and removed fixready labels Jun 2, 2018
@RemyLespagnol
Copy link
Contributor

@endiliey I can confirm that the issue is fixed when I reproduce your commit in my local environnent 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution status: claimed Issue has been claimed by a contributor who plans to work on it.
Projects
None yet
Development

No branches or pull requests

4 participants