[To be documented] React-static fails to start if rebuildRoutes() is put into static.config.js
See original GitHub issueyarn start
yarn run v1.22.4
$ react-static start
Starting Development Server...
Error: Routes cannot be rebuilt yet!
- getRoutes.js:12 Function.current
[rs-md]/[react-static]/src/static/getRoutes.js:12:9
- getRoutes.js:8 rebuildRoutes
[rs-md]/[react-static]/src/static/getRoutes.js:8:17
- static.config.js:7 Object.<anonymous>
/home/kanyck/sites/rs-md/static.config.js:7:1
- loader.js:1158 Module._compile
internal/modules/cjs/loader.js:1158:30
... and so on...
The same with chokidar:
yarn start
yarn run v1.22.4
$ react-static start
Starting Development Server...
Fetching Site Data...
[✓] Site Data Downloaded
/home/kanyck/sites/rs-md/node_modules/react-static/lib/static/getRoutes.js:40
throw new Error('Routes cannot be rebuilt yet!');
^
Error: Routes cannot be rebuilt yet!
at Function.current (/home/kanyck/sites/rs-md/node_modules/react-static/src/static/getRoutes.js:12:9)
at rebuildRoutes (/home/kanyck/sites/rs-md/node_modules/react-static/src/static/getRoutes.js:8:17)
at FSWatcher.<anonymous> (/home/kanyck/sites/rs-md/static.config.js:6:45)
at FSWatcher.emit (events.js:311:20)
at FSWatcher.<anonymous> (/home/kanyck/sites/rs-md/node_modules/chokidar/index.js:200:38)
at FSWatcher._emit (/home/kanyck/sites/rs-md/node_modules/chokidar/index.js:241:5)
at FSWatcher.NodeFsHandler._handleDir (/home/kanyck/sites/rs-md/node_modules/chokidar/lib/nodefs-handler.js:340:49)
at FSWatcher.<anonymous> (/home/kanyck/sites/rs-md/node_modules/chokidar/lib/nodefs-handler.js:462:19)
at FSWatcher.<anonymous> (/home/kanyck/sites/rs-md/node_modules/chokidar/lib/nodefs-handler.js:467:16)
at FSReqCallback.oncomplete (fs.js:167:5)
react-static v7.2.3
Steps to Reproduce the problem
- enable rebuildRoutes as described in api.md
- run
yarn start
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
react-static/config.md at master - GitHub
A static.config.js file is optional, but recommended at your project root to use react-static to its fullest potential. If present, it must default...
Read more >How to render the menu from the routes defined at static ...
Following the official guide, it should be something simple like this: //App.js import React from 'react' import { useRouteData } from ...
Read more >react-static | Yarn - Package Manager
In your static.config.js : Replace all instances of getProps with getData; Replace getSiteProps with getSiteData; If you are using a custom Document be...
Read more >Deploy a Create React App Static Site - Render
Deploy a Create React App static site on Render in just a few clicks. Served over a lightning-fast global CDN with fully managed...
Read more >react-static-plugin-preact - npm
Start using react-static-plugin-preact in your project by running `npm i ... Then add the plugin to your static.config.js :.
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
Not right now… Would have to find out how to PR, that would demand much more than 5 min (and switching the context). Sorry for that. I promise I’ll learn how to do that as soon as I have a spare hour))) BTW, is there a way to remove a bug label? It’s actually not a bug but docs kludge…
Yep! That works. I think this example should get into the docs, otherwise it’s quite confusing… Closing…