error retrieving static assets if basePath is set
See original GitHub issueAre you reporting a bug?
Yes
Environment
react-static -V
: 6.0.18node -v
: v10.13.0npm -v
: 6.4.1- Operating system: macOS
- Browser and version (if relevant): chrome
Steps to Reproduce the problem
Base your steps off of any freshly installed react-static template!
- Created a new site using
react-static create
basic template - modify static.config.js to include basePath and siteRoot
- deploy to gh-pages
Expected Behavior
Routing should work properly, but get 404 errors in browser console which xhr to retrieve routeInfo.json file. GET https://phaneendra.github.io/urbanrunners/https://phaneendra.github.io/urbanrunners/blog/routeInfo.json 404
seems the function getRoutePath to strip the path of window.location.origin is not called.
Reproducible Demo
https://github.com/phaneendra/urbanrunners http://phaneendra.github.io/urbanrunners/
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Basepath not working with public folder · Issue #20097 - GitHub
Basepath not working with public folder, the project go to production in a subfolder: igtown. basePath: '/igtown'. if set basepath in next.
Read more >Next.js Error Getting 404 When Fetching JS Resources After ...
from next.config.js file. This setting makes the assets path based on the current pages instead of the bath path url.
Read more >Base Path - next.config.js
js application under a sub-path of a domain you can use the basePath config option. basePath allows you to set a path prefix...
Read more >Static Web Asset has a conflicting web root path - Telerik UI for ...
Solution. Delete the _content folder from your wwwroot folder. The framework creates that folder build-time, and copies the static assets from the various ......
Read more >Static Assets - Docusaurus
Static assets are the non-code files that are directly copied to the build output. They include images, stylesheets, favicons, fonts, etc. By ...
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 Free
Top 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
Bump. This issue effectively rules out hosting on github/gitlab pages under a basepath, which may hinder adoption when users write docs for projects and host the docs directly on github/gitlab.
@tannerlinsley the problem is still existing on 7.0.0