[Bug] 404s every page after enabling watch('content') to reloadRoutes() in static.config.js
See original GitHub issueAre you reporting a bug?
Yes
Note: this issue originally filed on my rs-basic-test repo: https://github.com/theWebalyst/rs-basic-test/issues/1
Environment
react-static -V: 6.1.5
node -v: 8.11.3
npm -v: 6.4.1
Operating system: Ubuntu 18.10
Steps to Reproduce the problem
Starting with the basic template, I made small changes to get it to load content from markdown files by changing the relevant parts, based this other example: https://github.com/tannerlinsley/react-static-markdown (I chose to follow how that loads markdown having first failed to do this based on the code in the react-static archived markdown example).
You can reproduce the error by:
git clone https://github.com/theWebalyst/rs-basic-test/ && cd rs-basic-test && git checkout tags/take-content-from-markdown-files -b localtest && yarn && yarn start
- visit http://localhost:3000/ and confirm Home, About, Blog etc load ok
- remove the comment in static.config.js to enable reloadRoutes() at line 7
- things work as expected if you just edit content
- until you refresh the page or click on the navigation: Home, About, Blog etc all show a 404 error
I don’t see any errors in browser or terminal console (using Firefox), but note that there is still some console.log() debug output generated to the terminal by the build (see static.config.js 15-17)
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:13 (5 by maintainers)
Top Results From Across the Web
404s every page after enabling watch('content') to reloadRoutes() in ...
Using yarn start the localhost site displays home, about and blog posts as expected until I uncomment the following line in static.config.js :....
Read more >Next.js Error Getting 404 When Fetching JS Resources After ...
Solved by removing assetPrefix: "." from next.config.js file. This setting makes the assets path based on the current pages instead of the ...
Read more >ASP.NET Routing Debugger | You've Been Haacked
This utility displays the route data pulled from the request of the current request in ... ReloadRoutes() should be called after Listen() in ......
Read more >Azure Static website react.js getting 404 in the browser but ...
So like I normally setup static websites, with error page going back to index.html. The browser response shows a 404 though, on local...
Read more >static - JavaScript - MDN Web Docs - Mozilla
The static keyword defines a static method or field for a class, or a static initialization block (see the link for more information...
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
Yes I can.
On Thu, Mar 7, 2019 at 7:40 AM Oscar Beaumont notifications@github.com wrote:
I am also having this issue. If I startup react-static and then just save the
static.config.js
without even making a change to the file, all of my routes return 404.