🐛 BUG: `/foldername` does not resolve to `/foldername/index.html` in development.
See original GitHub issueQuick checklist
- I am using the latest version of Snowpack and all plugins.
What package manager are you using?
npm
What operating system are you using?
macOS
Describe the bug
Virtual server will resolve URL’s with trailing slashes, /foldername/
will resolve to /foldername/index.html
but /foldername
will yield cryptic messages in the terminal:
[22:01:05] [snowpack] Error: /Users/roy/new-dir/_output/foldername/index.html - Requested content "" but only built .html
[22:01:05] [snowpack] [500] /foldername
This is not how browsers or Vercel serve works, with or without trailing slash should yield an index.html
from inside a subfolder!
Thank you.
Steps to reproduce
git clone https://github.com/revelt/snowpack-trailing.git
cd snowpack-trailing
npm run start
- OPEN NEW TAB IN THE TERMINAL
open http://localhost:8080/sub
— NOTICE NO TRAILING SLASH IS PRESENT
It won’t work until trailing slash is added!
Link to minimal reproducible example (optional)
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Could not find a required file. Name: index.html - Stack Overflow
When I move my public folder into the client folder and run npm start I get "Can't find file. Name: index.html. Searched in...
Read more >`/foldername` does not resolve to `/foldername/index.html` in ...
I am using the latest version of Snowpack and all plugins. What package manager are you using? npm. What operating system are you...
Read more >React: Could not find a required file : r/learnprogramming
Could not find a required file Name: index.html Searched in project public folder. But index.html is actually there in public folder when I ......
Read more >could not find a required file. name: index.html - You.com
Run git status to view changed files. Open side panel. "Could not find a required file. Name: index.html" Error When Deploying React App...
Read more >Using Different Names for Index Files
Our Web servers support a variety of index file names by default. ... the Web server won't be able to find the file...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@lgarron I deleted my previous comment and reworked the repo case.
Confirmed, reproduced on 3.8.8. My workaround was fixing the issue previously between server restarts
Repo case https://github.com/Pyrolistical/trailing-slash-regression
Also, the
routes
workaround does fix the issue!I do believe it is related to https://github.com/snowpackjs/snowpack/issues/3605#issuecomment-913947246
Yes sorry, I meant #3521.
I need to be able to configure my dev to behave exactly like my production cdn or else I can’t use snowpack. It would cause too many “works on my machine” situations.
I would say the typical behaviour of production http servers is to rewrite both
http://localhost:8080/subfolder
andhttp://localhost:8080/subfolder/
tohttp://localhost:8080/subfolder/index.html
if it exists, or else 404. But definitely not 500!