vuepress
vuepress copied to clipboard
Cannot access static files nested in public folder
- [x] I confirm that this is an issue rather than a question.
Bug report
I have the following file structure in my .vuepress/public folder:
- public
- res
- tutorial9
- cube-diffuse.jpg
- cube.mtl
- cube.obj
- tutorial9
- res
While I can access a file in the pubic folder directly, I get a 404 when I try to access files inside of folders inside the public folder.
Steps to reproduce
- Create a new vuepress project (or use and existing one)
- Create a public folder in the .vuepress folder
- Create a folder inside the public folder
- Add any file into the nested folder
- Start the vuepress server
- Attempt to access the nested file
What is expected?
The file will accessible as it would be if it were in the root of the public folder.
What is actually happening?
Vuepress will give a 404 for the file. My guess is that this is due to the router catching the request and then 404ing because the route doesn't exist in config.js.
Other relevant information
-
Output of
npx vuepress infoin my VuePress project: Environment Info:System: OS: Linux 5.15 Pop!_OS 20.04 LTS CPU: (16) x64 AMD Ryzen 7 5700U with Radeon Graphics Binaries: Node: 16.13.0 - ~/.nvm/versions/node/v16.13.0/bin/node Yarn: 1.22.15 - ~/.nvm/versions/node/v16.13.0/bin/yarn npm: 8.1.0 - ~/.nvm/versions/node/v16.13.0/bin/npm Browsers: Chrome: Not Found Firefox: 95.0 npmPackages: @vuepress/core: 1.9.5 @vuepress/theme-default: 1.9.5 vuepress: ^1.9.5 => 1.9.5 npmGlobalPackages: vuepress: Not Found
Hi @sotrh,
First of all, thanks for your interest in VuePress 1.X :heart:
Can you provide a repo reproducing the error please so that I can help you in solving your incident?
Have a nice day/evening,
Cheers.
The code is at https://github.com/sotrh/learn-wgpu/tree/web2
You should then run yarn dev or npm run dev. You'll be able to access the files in the public folder (ie. localhost:8080/learn-wgpu/cube-diffuse.jpg`, but you'll get a 404 for any of the files in the nested res/tutorial9-models/res directory (ie. localhost:8080/learn-wgpu/res/tutorial9-models/res/cube-diffuse.jpg)
Hello, I am facing the same issue, any update on this?