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

when run "npm run build", index.html file only exists in build/xxx/en/ dir, but not copied to the root dir #468

Closed
loveky opened this issue Feb 22, 2018 · 7 comments
Labels
bug An error in the Docusaurus core causing instability or issues with its execution

Comments

@loveky
Copy link

loveky commented Feb 22, 2018

Is this a bug report?

Not Sure

Have you read the Contributing Guidelines?

Yes

Environment

Windows 7
Node 6.9.5
npm 3.10.10

Steps to Reproduce

(Write your steps here:)

  1. Follow the installation process
  2. run npm run build
  3. check the build directory

Expected Behavior

Want to see my index.html file in build/my-site-name/ directory. This behavior is documented at HERE

Actual Behavior

the index.html only appears in build/my-site-name/en directory

Reproducible Demo

Pleace check Steps to Reproduce

@JoelMarcey
Copy link
Contributor

Hi @loveky! Interesting. I followed your process and I see an index.html file in the root build/site directory. Do you have a repo I can look at to try to reproduce exactly?

@JoelMarcey JoelMarcey added the status: needs more information There is not enough information to take action on the issue. label Feb 26, 2018
@Happy-Ferret
Copy link
Contributor

Same issue here.

Repo: https://github.com/Anima-OS/dev-corner

@Happy-Ferret
Copy link
Contributor

I just tried doing the same on another machine, using just the default example and can reproduce this behavior.

@Happy-Ferret
Copy link
Contributor

I just checked again, this time using WSL (Windows Subsystem for Linux), because I had already suspected it might be due to a Windows specific bug.

Sure enough, there it generates the correct output.

@Happy-Ferret
Copy link
Contributor

Curious. I spend some time debugging the issue via VS Code earlier this morning.

Changing

writeFileAndCreateFolder(targetFile.replace('/en/', '/'), str);

on line 466 in generate.js

to

writeFileAndCreateFolder(targetFile.replace('en', '/'), str);

Seems to fix the issue.

Albeit that's clearly a hack and the proper way to fix this would probably just involve implementing the fix on line 437.

Namely, TODO: use path functions

@JoelMarcey JoelMarcey added bug An error in the Docusaurus core causing instability or issues with its execution platform-inconsistency and removed status: needs more information There is not enough information to take action on the issue. labels Mar 7, 2018
JoelMarcey added a commit to JoelMarcey/Docusaurus that referenced this issue Mar 8, 2018
We want to be more robust in our path string handling in order to not fail on various platforms.

Fixes facebook#468
@JoelMarcey
Copy link
Contributor

@Happy-Ferret Hi. Would you mind integrating #490 into your local repo and see if it fixes this problem for you?

@Happy-Ferret
Copy link
Contributor

I'll gladly test it once I'm back at the office, two hours from now.

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
Projects
None yet
Development

No branches or pull requests

3 participants