question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

error retrieving static assets if basePath is set

See original GitHub issue

Are you reporting a bug?

Yes

Environment

  1. react-static -V: 6.0.18
  2. node -v: v10.13.0
  3. npm -v: 6.4.1
  4. Operating system: macOS
  5. Browser and version (if relevant): chrome

Steps to Reproduce the problem

Base your steps off of any freshly installed react-static template!

  1. Created a new site using react-static create basic template
  2. modify static.config.js to include basePath and siteRoot
  3. 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:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

5reactions
Ziinccommented, Feb 9, 2019

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.

4reactions
elizyokcommented, May 11, 2019

@tannerlinsley the problem is still existing on 7.0.0

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found