Explore all Router open source software, libraries, packages, source code, cloud functions and APIs.

Popular New Releases in Router

react-router

vue-router

v3.5.3

mux

v1.8.0 ☀️

ui-router

1.0.29

ARouter

Optimization & Bugfix

Popular Libraries in Router

react-router

by remix-run doticontypescriptdoticon

star image 46674 doticonMIT

Declarative routing for React

react-router

by ReactTraining doticonjavascriptdoticon

star image 43698 doticonMIT

Declarative routing for React

vue-router

by vuejs doticonjavascriptdoticon

star image 18742 doticonMIT

🚦 The official router for Vue 2

mux

by gorilla doticongodoticon

star image 15602 doticonBSD-3-Clause

A powerful HTTP router and URL matcher for building Go web servers with 🦍

ui-router

by angular-ui doticontypescriptdoticon

star image 13773 doticonMIT

The de-facto solution to flexible routing with nested views in AngularJS

ARouter

by alibaba doticonjavadoticon

star image 13244 doticonApache-2.0

💪 A framework for assisting in the renovation of Android componentization (帮助 Android App 进行组件化改造的路由框架)

httprouter

by julienschmidt doticongodoticon

star image 12846 doticonBSD-3-Clause

A high performance HTTP request router that scales well

martini

by go-martini doticongodoticon

star image 11266 doticonMIT

Classy web framework for Go

barba

by barbajs doticontypescriptdoticon

star image 9474 doticonMIT

Create badass, fluid and smooth transition between your website's pages.

Trending New libraries in Router

axum

by tokio-rs doticonrustdoticon

star image 4413 doticonMIT

Ergonomic and modular web framework built with Tokio, Tower, and Hyper

whoami

by omer-dogan doticonshelldoticon

star image 873 doticonGPL-3.0

Whoami is a privacy tool developed to keep you anonymous on Debian-based linux operating systems at the highest level.

thgtoa

by AnonymousPlanet doticonhtmldoticon

star image 871 doticonNOASSERTION

The Hitchhiker’s Guide to Online Anonymity

newbee-mall-vue-app

by newbee-ltd doticonjavascriptdoticon

star image 708 doticonGPL-3.0

新蜂商城前后端分离版本-前端Vue项目源码

newbee-mall-vue3-app

by newbee-ltd doticonjavascriptdoticon

star image 648 doticonGPL-3.0

新蜂商城Vue3版本

react-keepalive-router

by GoodLuckAlien doticonjavascriptdoticon

star image 600 doticon

The react cache component developed based on react 16.8 +, react router 4 + can be used to cache page components, similar to Vue keepalive package Vue router effect function.(基于react 16.8+ ,react-router 4+ 开发的react缓存组件,可以用于缓存页面组件,类似vue的keepalive包裹vue-router的效果功能)。

DRouter

by didi doticonjavadoticon

star image 503 doticonApache-2.0

Android Router Framework

tinro

by AlexxNB doticonjavascriptdoticon

star image 432 doticonMIT

Highly declarative, tiny, dependency free router for Svelte's web applications.

svelte-navigator

by mefechoel doticonjavascriptdoticon

star image 310 doticonNOASSERTION

Simple, accessible routing for Svelte

Top Authors in Router

1

ui-router

9 Libraries

star icon1244

2

MacKentoch

9 Libraries

star icon672

3

guardianproject

8 Libraries

star icon345

4

Whonix

8 Libraries

star icon87

5

egoist

8 Libraries

star icon796

6

DonnchaC

8 Libraries

star icon433

7

NullHypothesis

7 Libraries

star icon791

8

torproject

7 Libraries

star icon3272

9

ktsn

7 Libraries

star icon861

10

dburles

6 Libraries

star icon71

1

9 Libraries

star icon1244

2

9 Libraries

star icon672

3

8 Libraries

star icon345

4

8 Libraries

star icon87

5

8 Libraries

star icon796

6

8 Libraries

star icon433

7

7 Libraries

star icon791

8

7 Libraries

star icon3272

9

7 Libraries

star icon861

10

6 Libraries

star icon71

Trending Kits in Router

No Trending Kits are available at this moment for Router

Trending Discussions on Router

is there a way to set a default route with React-Router v6

useNavigate() may be used only in the context of a <Router> component

AngularFireModule and AngularFireDatabaseModule not being found in @angular/fire

Error: [Home] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>

Error: useHref() may be used only in the context of a <Router> component. It works when I directly put the url as localhost:3000/experiences

react router v6 navigate outside of components

The unauthenticated git protocol on port 9418 is no longer supported

What is the alternative for Redirect in react-router-dom v 6.0.0?

How to redirect in React Router v6?

Error: [PrivateRoute] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>

QUESTION

is there a way to set a default route with React-Router v6

Asked 2022-Apr-04 at 17:48

I just can't find a way to set a default route with react-router v6

Is it because it's not good programming anymore?

Can somebody tell me why?

Thanks in advance

Rafael

ANSWER

Answered 2022-Apr-04 at 17:48

If I understand your question about a "default" route correctly then I am interpreting this as one of the following:

  1. Use an index route:

    You can wrap a set of routes in a layout route and specify an index route:

1 <Routes>
2   <Route path="/*">
3     <Route index element={<ComponentA />} />
4     <Route path="pathB" element={<ComponentB />} />
5     <Route path="pathC" element={<ComponentC />} />
6   </Route>
7 </Routes>
8

The index route is the route that will be matched and rendered when the path exactly matches the root parent route's path.

  • Redirect to a "default" route if no other routes match:

    You can also render a redirect to the route you consider to be the "default" route.

  • 1 <Routes>
    2   <Route path="/*">
    3     <Route index element={<ComponentA />} />
    4     <Route path="pathB" element={<ComponentB />} />
    5     <Route path="pathC" element={<ComponentC />} />
    6   </Route>
    7 </Routes>
    8 <Routes>
    9   <Route path="/pathA element={<ComponentA />} />
    10   <Route path="/pathB" element={<ComponentB />} />
    11   <Route path="/pathC" element={<ComponentC />} />
    12   <Route path="*" element={<Navigate to="/pathA" replace />} />
    13 </Routes>
    14

    Source https://stackoverflow.com/questions/70437952

    QUESTION

    useNavigate() may be used only in the context of a <Router> component

    Asked 2022-Apr-02 at 20:39

    My code currently is this and I'm trying to add this button that goes back to the previous page using react-router-dom but I get an error saying 'useNavigate() may be used only in the context of a component.' and also all the components on my website disappears.

    1function App() {
    2  const navigate = useNavigate();
    3  return (
    4    <BrowserRouter>
    5      <div>
    6      <button onClick={() => navigate(-1)}>go back</button>
    7        <Nav/>
    8        <Routes>
    9          <Route exact path="/" element={<Home/>}/>
    10          <Route exact path="/home" element={<Home/>}/>
    11          <Route exact path="/upcoming/:user" element={<Upcoming/>}/>
    12          <Route exact path="/record/:user" element={<Record/>}/>
    13          <Route path="*" element={<NotFound/>}/>
    14        </Routes>
    15      </div>
    16    </BrowserRouter>
    17  );
    18}
    19

    This is the error I got in console

    Error

    ANSWER

    Answered 2022-Mar-08 at 07:27

    This error throws in useNavigate. useInRouterContext will check if the component is a descendant of a <Router>.

    Here's the source code to explain why you can't use useNavigate, useLocation outside of the Router component:

    useNavigate uses useLocation underly, useLocation will get the location from LocationContext. If you want to get the react context, you should render the component as the descendant of a context provider. Router component use the LocationContext.Provider and NavigationContext.Provider. That's why you need to render the component as the children, so that useNavigate hook can get the context data from NavigationContext and LocationContext providers.

    Your environment is browser, so you need to use BrowserRouter. BrowserRouter is built based on Router.

    Refactor to this:

    App.jsx:

    1function App() {
    2  const navigate = useNavigate();
    3  return (
    4    &lt;BrowserRouter&gt;
    5      &lt;div&gt;
    6      &lt;button onClick={() =&gt; navigate(-1)}&gt;go back&lt;/button&gt;
    7        &lt;Nav/&gt;
    8        &lt;Routes&gt;
    9          &lt;Route exact path=&quot;/&quot; element={&lt;Home/&gt;}/&gt;
    10          &lt;Route exact path=&quot;/home&quot; element={&lt;Home/&gt;}/&gt;
    11          &lt;Route exact path=&quot;/upcoming/:user&quot; element={&lt;Upcoming/&gt;}/&gt;
    12          &lt;Route exact path=&quot;/record/:user&quot; element={&lt;Record/&gt;}/&gt;
    13          &lt;Route path=&quot;*&quot; element={&lt;NotFound/&gt;}/&gt;
    14        &lt;/Routes&gt;
    15      &lt;/div&gt;
    16    &lt;/BrowserRouter&gt;
    17  );
    18}
    19function App() {
    20  const navigate = useNavigate();
    21  return (
    22      &lt;div&gt;
    23        &lt;button onClick={() =&gt; navigate(-1)}&gt;go back&lt;/button&gt;
    24        &lt;Nav/&gt;
    25        &lt;Routes&gt;
    26          &lt;Route exact path=&quot;/&quot; element={&lt;Home/&gt;}/&gt;
    27          &lt;Route exact path=&quot;/home&quot; element={&lt;Home/&gt;}/&gt;
    28          &lt;Route exact path=&quot;/upcoming/:user&quot; element={&lt;Upcoming/&gt;}/&gt;
    29          &lt;Route exact path=&quot;/record/:user&quot; element={&lt;Record/&gt;}/&gt;
    30          &lt;Route path=&quot;*&quot; element={&lt;NotFound/&gt;}/&gt;
    31        &lt;/Routes&gt;
    32      &lt;/div&gt;
    33  );
    34}
    35

    index.jsx:

    1function App() {
    2  const navigate = useNavigate();
    3  return (
    4    &lt;BrowserRouter&gt;
    5      &lt;div&gt;
    6      &lt;button onClick={() =&gt; navigate(-1)}&gt;go back&lt;/button&gt;
    7        &lt;Nav/&gt;
    8        &lt;Routes&gt;
    9          &lt;Route exact path=&quot;/&quot; element={&lt;Home/&gt;}/&gt;
    10          &lt;Route exact path=&quot;/home&quot; element={&lt;Home/&gt;}/&gt;
    11          &lt;Route exact path=&quot;/upcoming/:user&quot; element={&lt;Upcoming/&gt;}/&gt;
    12          &lt;Route exact path=&quot;/record/:user&quot; element={&lt;Record/&gt;}/&gt;
    13          &lt;Route path=&quot;*&quot; element={&lt;NotFound/&gt;}/&gt;
    14        &lt;/Routes&gt;
    15      &lt;/div&gt;
    16    &lt;/BrowserRouter&gt;
    17  );
    18}
    19function App() {
    20  const navigate = useNavigate();
    21  return (
    22      &lt;div&gt;
    23        &lt;button onClick={() =&gt; navigate(-1)}&gt;go back&lt;/button&gt;
    24        &lt;Nav/&gt;
    25        &lt;Routes&gt;
    26          &lt;Route exact path=&quot;/&quot; element={&lt;Home/&gt;}/&gt;
    27          &lt;Route exact path=&quot;/home&quot; element={&lt;Home/&gt;}/&gt;
    28          &lt;Route exact path=&quot;/upcoming/:user&quot; element={&lt;Upcoming/&gt;}/&gt;
    29          &lt;Route exact path=&quot;/record/:user&quot; element={&lt;Record/&gt;}/&gt;
    30          &lt;Route path=&quot;*&quot; element={&lt;NotFound/&gt;}/&gt;
    31        &lt;/Routes&gt;
    32      &lt;/div&gt;
    33  );
    34}
    35import ReactDOM from 'react-dom';
    36import { BrowserRouter } from 'react-router-dom';
    37import App from './App';
    38
    39ReactDOM.render(
    40  &lt;BrowserRouter&gt;
    41    &lt;App/&gt;
    42  &lt;/BrowserRouter&gt;,
    43  document.getElementById('root')
    44)
    45

    Source https://stackoverflow.com/questions/70491774

    QUESTION

    AngularFireModule and AngularFireDatabaseModule not being found in @angular/fire

    Asked 2022-Apr-01 at 12:56

    I am trying to implement Firebase Realtime Database into a angular project and Im getting stuck at one of the very first steps. Importing AngularFireModule and AngularFireDatabaseModule. It gives me the following error:

    1Module '&quot;@angular/fire&quot;' has no exported member 'AngularFireModule'.ts(2305)
    2
    1Module '&quot;@angular/fire&quot;' has no exported member 'AngularFireModule'.ts(2305)
    2Module '&quot;@angular/fire/database&quot;' has no exported member 'AngularFireDatabaseModule'.
    3

    And here is how I am importing them:

    1Module '&quot;@angular/fire&quot;' has no exported member 'AngularFireModule'.ts(2305)
    2Module '&quot;@angular/fire/database&quot;' has no exported member 'AngularFireDatabaseModule'.
    3import {AngularFireModule } from '@angular/fire';
    4import {AngularFireDatabaseModule} from '@angular/fire/database'
    5

    Am I missing something here? I have installed @angular/fire via the command

    1Module '&quot;@angular/fire&quot;' has no exported member 'AngularFireModule'.ts(2305)
    2Module '&quot;@angular/fire/database&quot;' has no exported member 'AngularFireDatabaseModule'.
    3import {AngularFireModule } from '@angular/fire';
    4import {AngularFireDatabaseModule} from '@angular/fire/database'
    5npm i firebase @angular/fire
    6

    and have also installed firebase tools. Here is a list of the Angular packages I currently have installed and their versions:

    1Module '&quot;@angular/fire&quot;' has no exported member 'AngularFireModule'.ts(2305)
    2Module '&quot;@angular/fire/database&quot;' has no exported member 'AngularFireDatabaseModule'.
    3import {AngularFireModule } from '@angular/fire';
    4import {AngularFireDatabaseModule} from '@angular/fire/database'
    5npm i firebase @angular/fire
    6Angular CLI: 12.2.2
    7Node: 14.17.4
    8Package Manager: npm 6.14.14
    9OS: win32 x64
    10
    11Angular: 12.2.3
    12... animations, common, compiler, compiler-cli, core, forms
    13... platform-browser, platform-browser-dynamic, router
    14
    15Package                         Version
    16---------------------------------------------------------
    17@angular-devkit/architect       0.1202.2
    18@angular-devkit/build-angular   12.2.2
    19@angular-devkit/core            12.2.2
    20@angular-devkit/schematics      12.2.2
    21@angular/cli                    12.2.2
    22@angular/fire                   7.0.0
    23@schematics/angular             12.2.2
    24rxjs                            6.6.7
    25typescript                      4.3.5
    26

    I do apologise if this is all excessive information but I am completely stuck as to what the issue is. Any help would be GREATLY appreciated. Right now my suspicion is that its a compatibility issue or perhaps a feature that doesnt exist anymore on the latest versions but I really dont know.

    ANSWER

    Answered 2021-Aug-26 at 13:20

    AngularFire 7.0.0 was launched yesterday with a new API that has a lot of bundle size reduction benefits.

    Instead of top level classes like AngularFireDatabase, you can now import smaller independent functions.

    1Module '&quot;@angular/fire&quot;' has no exported member 'AngularFireModule'.ts(2305)
    2Module '&quot;@angular/fire/database&quot;' has no exported member 'AngularFireDatabaseModule'.
    3import {AngularFireModule } from '@angular/fire';
    4import {AngularFireDatabaseModule} from '@angular/fire/database'
    5npm i firebase @angular/fire
    6Angular CLI: 12.2.2
    7Node: 14.17.4
    8Package Manager: npm 6.14.14
    9OS: win32 x64
    10
    11Angular: 12.2.3
    12... animations, common, compiler, compiler-cli, core, forms
    13... platform-browser, platform-browser-dynamic, router
    14
    15Package                         Version
    16---------------------------------------------------------
    17@angular-devkit/architect       0.1202.2
    18@angular-devkit/build-angular   12.2.2
    19@angular-devkit/core            12.2.2
    20@angular-devkit/schematics      12.2.2
    21@angular/cli                    12.2.2
    22@angular/fire                   7.0.0
    23@schematics/angular             12.2.2
    24rxjs                            6.6.7
    25typescript                      4.3.5
    26import { list } from '@angular/fire/database';
    27

    The initialization process is a bit different too as it has a more flexible API for specifying configurations.

    1Module '&quot;@angular/fire&quot;' has no exported member 'AngularFireModule'.ts(2305)
    2Module '&quot;@angular/fire/database&quot;' has no exported member 'AngularFireDatabaseModule'.
    3import {AngularFireModule } from '@angular/fire';
    4import {AngularFireDatabaseModule} from '@angular/fire/database'
    5npm i firebase @angular/fire
    6Angular CLI: 12.2.2
    7Node: 14.17.4
    8Package Manager: npm 6.14.14
    9OS: win32 x64
    10
    11Angular: 12.2.3
    12... animations, common, compiler, compiler-cli, core, forms
    13... platform-browser, platform-browser-dynamic, router
    14
    15Package                         Version
    16---------------------------------------------------------
    17@angular-devkit/architect       0.1202.2
    18@angular-devkit/build-angular   12.2.2
    19@angular-devkit/core            12.2.2
    20@angular-devkit/schematics      12.2.2
    21@angular/cli                    12.2.2
    22@angular/fire                   7.0.0
    23@schematics/angular             12.2.2
    24rxjs                            6.6.7
    25typescript                      4.3.5
    26import { list } from '@angular/fire/database';
    27@NgModule({
    28    imports: [
    29        provideFirebaseApp(() =&gt; initializeApp(config)),
    30        provideFirestore(() =&gt; {
    31            const firestore = getFirestore();
    32            connectEmulator(firestore, 'localhost', 8080);
    33            enableIndexedDbPersistence(firestore);
    34            return firestore;
    35        }),
    36        provideStorage(() =&gt; getStorage()),
    37    ],
    38})
    39

    If you want to proceed with the older API there's a compatibility layer.

    1Module '&quot;@angular/fire&quot;' has no exported member 'AngularFireModule'.ts(2305)
    2Module '&quot;@angular/fire/database&quot;' has no exported member 'AngularFireDatabaseModule'.
    3import {AngularFireModule } from '@angular/fire';
    4import {AngularFireDatabaseModule} from '@angular/fire/database'
    5npm i firebase @angular/fire
    6Angular CLI: 12.2.2
    7Node: 14.17.4
    8Package Manager: npm 6.14.14
    9OS: win32 x64
    10
    11Angular: 12.2.3
    12... animations, common, compiler, compiler-cli, core, forms
    13... platform-browser, platform-browser-dynamic, router
    14
    15Package                         Version
    16---------------------------------------------------------
    17@angular-devkit/architect       0.1202.2
    18@angular-devkit/build-angular   12.2.2
    19@angular-devkit/core            12.2.2
    20@angular-devkit/schematics      12.2.2
    21@angular/cli                    12.2.2
    22@angular/fire                   7.0.0
    23@schematics/angular             12.2.2
    24rxjs                            6.6.7
    25typescript                      4.3.5
    26import { list } from '@angular/fire/database';
    27@NgModule({
    28    imports: [
    29        provideFirebaseApp(() =&gt; initializeApp(config)),
    30        provideFirestore(() =&gt; {
    31            const firestore = getFirestore();
    32            connectEmulator(firestore, 'localhost', 8080);
    33            enableIndexedDbPersistence(firestore);
    34            return firestore;
    35        }),
    36        provideStorage(() =&gt; getStorage()),
    37    ],
    38})
    39import { AngularFireModule} from '@angular/fire/compat'
    40import { AngularFireDatabaseModule } from '@angular/fire/compat/database';
    41

    Source https://stackoverflow.com/questions/68939014

    QUESTION

    Error: [Home] is not a &lt;Route&gt; component. All component children of &lt;Routes&gt; must be a &lt;Route&gt; or &lt;React.Fragment&gt;

    Asked 2022-Apr-01 at 11:28

    Hello fellow friends I am trying to create my own app but facing issues after updating the react-router-dom to 6.02 I am getting this error

    Error: [Home] is not a Route component. All component children of Routes must be a Route or <React.Fragment>

    the code is the following

    1import { BrowserRouter, Route, Routes } from &quot;react-router-dom&quot;;
    2import Navbar from &quot;./components/Navbar/Navbar&quot;;
    3import Home from &quot;./pages/home/Home&quot;;
    4import Login from &quot;./pages/login/Login&quot;;
    5import Signup from &quot;./pages/signup/Signup&quot;;
    6
    7function App() {
    8  return (
    9    &lt;div className=&quot;App&quot;&gt;
    10      &lt;BrowserRouter&gt;
    11          &lt;Navbar /&gt;
    12          &lt;Routes&gt;
    13            &lt;Route exact path=&quot;/&quot;&gt;
    14              &lt;Home /&gt;
    15            &lt;/Route&gt;
    16            &lt;Route path=&quot;/login&quot;&gt;
    17              &lt;Login /&gt;
    18            &lt;/Route&gt;
    19            &lt;Route path=&quot;/signup&quot;&gt;
    20              &lt;Signup /&gt;
    21            &lt;/Route&gt;
    22          &lt;/Routes&gt;
    23      &lt;/BrowserRouter&gt;
    24    &lt;/div&gt;
    25  );
    26}
    27
    28export default App;
    29

    ANSWER

    Answered 2021-Nov-15 at 14:23

    <Route path="/" element={<Home />} />

    Migrating to v6

    Source https://stackoverflow.com/questions/69975792

    QUESTION

    Error: useHref() may be used only in the context of a &lt;Router&gt; component. It works when I directly put the url as localhost:3000/experiences

    Asked 2022-Mar-30 at 02:44

    I have a navbar that is rendered in every route while the route changes on click.

    ./components/navbar.jsx

    1import React, { Component } from 'react';
    2import '../App.css';
    3import { Link } from 'react-router-dom';
    4
    5
    6
    7class Navbar extends Component {
    8    constructor(props) {
    9        super(props);
    10        this.state = {};
    11    }
    12    render() {
    13        return (
    14            &lt;div id = 'navbar'&gt;
    15
    16                &lt;div className='name-head'&gt;
    17                    My Name
    18                &lt;/div&gt;
    19            
    20            
    21                &lt;div id = 'nav-links-container'&gt;
    22                    
    23                    &lt;Link to='/experiences'&gt;
    24                        &lt;div className = 'nav-links'&gt;
    25                            Experiences
    26                        &lt;/div&gt;
    27                    &lt;/Link&gt;
    28
    29                    &lt;div className = 'nav-links'&gt;
    30                        Projects
    31                    &lt;/div&gt;
    32
    33                    &lt;div className = 'nav-links'&gt;
    34                        Skills
    35                    &lt;/div&gt;
    36
    37                    &lt;div className = 'nav-links'&gt;
    38                        Resume
    39                    &lt;/div&gt;
    40
    41                &lt;/div&gt;
    42                
    43            &lt;/div&gt;
    44        );
    45    }
    46}
    47
    48export default Navbar;
    49

    ./components/experiences.jsx

    1import React, { Component } from 'react';
    2import '../App.css';
    3import { Link } from 'react-router-dom';
    4
    5
    6
    7class Navbar extends Component {
    8    constructor(props) {
    9        super(props);
    10        this.state = {};
    11    }
    12    render() {
    13        return (
    14            &lt;div id = 'navbar'&gt;
    15
    16                &lt;div className='name-head'&gt;
    17                    My Name
    18                &lt;/div&gt;
    19            
    20            
    21                &lt;div id = 'nav-links-container'&gt;
    22                    
    23                    &lt;Link to='/experiences'&gt;
    24                        &lt;div className = 'nav-links'&gt;
    25                            Experiences
    26                        &lt;/div&gt;
    27                    &lt;/Link&gt;
    28
    29                    &lt;div className = 'nav-links'&gt;
    30                        Projects
    31                    &lt;/div&gt;
    32
    33                    &lt;div className = 'nav-links'&gt;
    34                        Skills
    35                    &lt;/div&gt;
    36
    37                    &lt;div className = 'nav-links'&gt;
    38                        Resume
    39                    &lt;/div&gt;
    40
    41                &lt;/div&gt;
    42                
    43            &lt;/div&gt;
    44        );
    45    }
    46}
    47
    48export default Navbar;
    49import React, { Component } from 'react';
    50
    51
    52class Experiences extends Component {
    53    
    54    render() { 
    55        return (
    56            &lt;div&gt;
    57                &lt;h1&gt;hi&lt;/h1&gt;
    58            &lt;/div&gt;
    59        );
    60    }
    61}
    62 
    63export default Experiences;
    64

    index.js

    1import React, { Component } from 'react';
    2import '../App.css';
    3import { Link } from 'react-router-dom';
    4
    5
    6
    7class Navbar extends Component {
    8    constructor(props) {
    9        super(props);
    10        this.state = {};
    11    }
    12    render() {
    13        return (
    14            &lt;div id = 'navbar'&gt;
    15
    16                &lt;div className='name-head'&gt;
    17                    My Name
    18                &lt;/div&gt;
    19            
    20            
    21                &lt;div id = 'nav-links-container'&gt;
    22                    
    23                    &lt;Link to='/experiences'&gt;
    24                        &lt;div className = 'nav-links'&gt;
    25                            Experiences
    26                        &lt;/div&gt;
    27                    &lt;/Link&gt;
    28
    29                    &lt;div className = 'nav-links'&gt;
    30                        Projects
    31                    &lt;/div&gt;
    32
    33                    &lt;div className = 'nav-links'&gt;
    34                        Skills
    35                    &lt;/div&gt;
    36
    37                    &lt;div className = 'nav-links'&gt;
    38                        Resume
    39                    &lt;/div&gt;
    40
    41                &lt;/div&gt;
    42                
    43            &lt;/div&gt;
    44        );
    45    }
    46}
    47
    48export default Navbar;
    49import React, { Component } from 'react';
    50
    51
    52class Experiences extends Component {
    53    
    54    render() { 
    55        return (
    56            &lt;div&gt;
    57                &lt;h1&gt;hi&lt;/h1&gt;
    58            &lt;/div&gt;
    59        );
    60    }
    61}
    62 
    63export default Experiences;
    64import React from 'react';
    65import ReactDOM from 'react-dom';
    66import './index.css';
    67import reportWebVitals from './reportWebVitals';
    68import Navbar from './components/Navbar';
    69import Home from './components/Home';
    70import Experiences from './components/experience';
    71
    72import {
    73  BrowserRouter as Router, 
    74  Routes, 
    75  Route
    76} from 'react-router-dom';
    77
    78
    79
    80ReactDOM.render(
    81
    82  &lt;React.StrictMode&gt;
    83
    84    &lt;Navbar /&gt;
    85
    86    &lt;Router&gt;
    87
    88      &lt;Routes&gt;
    89        &lt;Route path=&quot;/&quot; element={&lt;Home /&gt;} /&gt;
    90        &lt;Route path=&quot;/experiences&quot; element={&lt;Experiences /&gt;} /&gt;
    91      &lt;/Routes&gt;
    92
    93    &lt;/Router&gt;
    94
    95  &lt;/React.StrictMode&gt;,
    96
    97  document.getElementById('root')
    98);
    99
    100
    101reportWebVitals();
    102

    The error doesn't come when I remove the <Link> from the experiences tag in navbar. There is a similar question posted here: Error: useHref() may be used only in the context of a <Router> component but doesn't help.

    I'm using react router v6

    ANSWER

    Answered 2022-Feb-09 at 23:28
    Issue

    You are rendering the navbar outside the routing context. The Router isn't aware of what routes the links are attempting to link to that it is managing. The reason routing works when directly navigating to "/experiences" is because the Router is aware of the URL when the app mounts.

    1import React, { Component } from 'react';
    2import '../App.css';
    3import { Link } from 'react-router-dom';
    4
    5
    6
    7class Navbar extends Component {
    8    constructor(props) {
    9        super(props);
    10        this.state = {};
    11    }
    12    render() {
    13        return (
    14            &lt;div id = 'navbar'&gt;
    15
    16                &lt;div className='name-head'&gt;
    17                    My Name
    18                &lt;/div&gt;
    19            
    20            
    21                &lt;div id = 'nav-links-container'&gt;
    22                    
    23                    &lt;Link to='/experiences'&gt;
    24                        &lt;div className = 'nav-links'&gt;
    25                            Experiences
    26                        &lt;/div&gt;
    27                    &lt;/Link&gt;
    28
    29                    &lt;div className = 'nav-links'&gt;
    30                        Projects
    31                    &lt;/div&gt;
    32
    33                    &lt;div className = 'nav-links'&gt;
    34                        Skills
    35                    &lt;/div&gt;
    36
    37                    &lt;div className = 'nav-links'&gt;
    38                        Resume
    39                    &lt;/div&gt;
    40
    41                &lt;/div&gt;
    42                
    43            &lt;/div&gt;
    44        );
    45    }
    46}
    47
    48export default Navbar;
    49import React, { Component } from 'react';
    50
    51
    52class Experiences extends Component {
    53    
    54    render() { 
    55        return (
    56            &lt;div&gt;
    57                &lt;h1&gt;hi&lt;/h1&gt;
    58            &lt;/div&gt;
    59        );
    60    }
    61}
    62 
    63export default Experiences;
    64import React from 'react';
    65import ReactDOM from 'react-dom';
    66import './index.css';
    67import reportWebVitals from './reportWebVitals';
    68import Navbar from './components/Navbar';
    69import Home from './components/Home';
    70import Experiences from './components/experience';
    71
    72import {
    73  BrowserRouter as Router, 
    74  Routes, 
    75  Route
    76} from 'react-router-dom';
    77
    78
    79
    80ReactDOM.render(
    81
    82  &lt;React.StrictMode&gt;
    83
    84    &lt;Navbar /&gt;
    85
    86    &lt;Router&gt;
    87
    88      &lt;Routes&gt;
    89        &lt;Route path=&quot;/&quot; element={&lt;Home /&gt;} /&gt;
    90        &lt;Route path=&quot;/experiences&quot; element={&lt;Experiences /&gt;} /&gt;
    91      &lt;/Routes&gt;
    92
    93    &lt;/Router&gt;
    94
    95  &lt;/React.StrictMode&gt;,
    96
    97  document.getElementById('root')
    98);
    99
    100
    101reportWebVitals();
    102&lt;Navbar /&gt; // &lt;-- outside router!!
    103
    104&lt;Router&gt;
    105  &lt;Routes&gt;
    106    &lt;Route path=&quot;/&quot; element={&lt;Home /&gt;} /&gt;
    107    &lt;Route path=&quot;/experiences&quot; element={&lt;Experiences /&gt;} /&gt;
    108  &lt;/Routes&gt;
    109&lt;/Router&gt;
    110
    Solution

    Move it inside the routing context so the Router is aware and can manage routing correctly.

    1import React, { Component } from 'react';
    2import '../App.css';
    3import { Link } from 'react-router-dom';
    4
    5
    6
    7class Navbar extends Component {
    8    constructor(props) {
    9        super(props);
    10        this.state = {};
    11    }
    12    render() {
    13        return (
    14            &lt;div id = 'navbar'&gt;
    15
    16                &lt;div className='name-head'&gt;
    17                    My Name
    18                &lt;/div&gt;
    19            
    20            
    21                &lt;div id = 'nav-links-container'&gt;
    22                    
    23                    &lt;Link to='/experiences'&gt;
    24                        &lt;div className = 'nav-links'&gt;
    25                            Experiences
    26                        &lt;/div&gt;
    27                    &lt;/Link&gt;
    28
    29                    &lt;div className = 'nav-links'&gt;
    30                        Projects
    31                    &lt;/div&gt;
    32
    33                    &lt;div className = 'nav-links'&gt;
    34                        Skills
    35                    &lt;/div&gt;
    36
    37                    &lt;div className = 'nav-links'&gt;
    38                        Resume
    39                    &lt;/div&gt;
    40
    41                &lt;/div&gt;
    42                
    43            &lt;/div&gt;
    44        );
    45    }
    46}
    47
    48export default Navbar;
    49import React, { Component } from 'react';
    50
    51
    52class Experiences extends Component {
    53    
    54    render() { 
    55        return (
    56            &lt;div&gt;
    57                &lt;h1&gt;hi&lt;/h1&gt;
    58            &lt;/div&gt;
    59        );
    60    }
    61}
    62 
    63export default Experiences;
    64import React from 'react';
    65import ReactDOM from 'react-dom';
    66import './index.css';
    67import reportWebVitals from './reportWebVitals';
    68import Navbar from './components/Navbar';
    69import Home from './components/Home';
    70import Experiences from './components/experience';
    71
    72import {
    73  BrowserRouter as Router, 
    74  Routes, 
    75  Route
    76} from 'react-router-dom';
    77
    78
    79
    80ReactDOM.render(
    81
    82  &lt;React.StrictMode&gt;
    83
    84    &lt;Navbar /&gt;
    85
    86    &lt;Router&gt;
    87
    88      &lt;Routes&gt;
    89        &lt;Route path=&quot;/&quot; element={&lt;Home /&gt;} /&gt;
    90        &lt;Route path=&quot;/experiences&quot; element={&lt;Experiences /&gt;} /&gt;
    91      &lt;/Routes&gt;
    92
    93    &lt;/Router&gt;
    94
    95  &lt;/React.StrictMode&gt;,
    96
    97  document.getElementById('root')
    98);
    99
    100
    101reportWebVitals();
    102&lt;Navbar /&gt; // &lt;-- outside router!!
    103
    104&lt;Router&gt;
    105  &lt;Routes&gt;
    106    &lt;Route path=&quot;/&quot; element={&lt;Home /&gt;} /&gt;
    107    &lt;Route path=&quot;/experiences&quot; element={&lt;Experiences /&gt;} /&gt;
    108  &lt;/Routes&gt;
    109&lt;/Router&gt;
    110&lt;Router&gt;
    111  &lt;Navbar /&gt;
    112  &lt;Routes&gt;
    113    &lt;Route path=&quot;/&quot; element={&lt;Home /&gt;} /&gt;
    114    &lt;Route path=&quot;/experiences&quot; element={&lt;Experiences /&gt;} /&gt;
    115  &lt;/Routes&gt;
    116&lt;/Router&gt;
    117

    Source https://stackoverflow.com/questions/70220413

    QUESTION

    react router v6 navigate outside of components

    Asked 2022-Mar-28 at 11:19

    In react-router v5 i created history object like this:

    1import { createBrowserHistory } from &quot;history&quot;;
    2export const history = createBrowserHistory();
    3

    And then passed it to the Router:

    1import { createBrowserHistory } from &quot;history&quot;;
    2export const history = createBrowserHistory();
    3import { Router, Switch, Route, Link } from &quot;react-router-dom&quot;;
    4&lt;Router history={history}&gt;
    5 ... my routes
    6&lt;/Router&gt;
    7

    I did it for the opportunity to usage history outside of component:

    1import { createBrowserHistory } from &quot;history&quot;;
    2export const history = createBrowserHistory();
    3import { Router, Switch, Route, Link } from &quot;react-router-dom&quot;;
    4&lt;Router history={history}&gt;
    5 ... my routes
    6&lt;/Router&gt;
    7   // store action
    8    logout() {
    9        this.user = null;
    10        history.push('/');
    11    }
    12

    This way I moved the logic to the store and the components were kept as clean as possible. But now, in react router v6 i cant do the same. I can still navigate using useNavigate() inside my component, but i cannot create a navigate to use its into my store. Is there any alternative?

    ANSWER

    Answered 2021-Nov-17 at 07:20

    Well, it turns out you can duplicate the behavior if you implement a custom router that instantiates the history state in the same manner as RRDv6 routers.

    Examine the BrowserRouter implementation for example:

    1import { createBrowserHistory } from &quot;history&quot;;
    2export const history = createBrowserHistory();
    3import { Router, Switch, Route, Link } from &quot;react-router-dom&quot;;
    4&lt;Router history={history}&gt;
    5 ... my routes
    6&lt;/Router&gt;
    7   // store action
    8    logout() {
    9        this.user = null;
    10        history.push('/');
    11    }
    12export function BrowserRouter({
    13  basename,
    14  children,
    15  window
    16}: BrowserRouterProps) {
    17  let historyRef = React.useRef&lt;BrowserHistory&gt;();
    18  if (historyRef.current == null) {
    19    historyRef.current = createBrowserHistory({ window });
    20  }
    21
    22  let history = historyRef.current;
    23  let [state, setState] = React.useState({
    24    action: history.action,
    25    location: history.location
    26  });
    27
    28  React.useLayoutEffect(() =&gt; history.listen(setState), [history]);
    29
    30  return (
    31    &lt;Router
    32      basename={basename}
    33      children={children}
    34      location={state.location}
    35      navigationType={state.action}
    36      navigator={history}
    37    /&gt;
    38  );
    39}
    40

    Create a CustomRouter that consumes a custom history object and manages the state:

    1import { createBrowserHistory } from &quot;history&quot;;
    2export const history = createBrowserHistory();
    3import { Router, Switch, Route, Link } from &quot;react-router-dom&quot;;
    4&lt;Router history={history}&gt;
    5 ... my routes
    6&lt;/Router&gt;
    7   // store action
    8    logout() {
    9        this.user = null;
    10        history.push('/');
    11    }
    12export function BrowserRouter({
    13  basename,
    14  children,
    15  window
    16}: BrowserRouterProps) {
    17  let historyRef = React.useRef&lt;BrowserHistory&gt;();
    18  if (historyRef.current == null) {
    19    historyRef.current = createBrowserHistory({ window });
    20  }
    21
    22  let history = historyRef.current;
    23  let [state, setState] = React.useState({
    24    action: history.action,
    25    location: history.location
    26  });
    27
    28  React.useLayoutEffect(() =&gt; history.listen(setState), [history]);
    29
    30  return (
    31    &lt;Router
    32      basename={basename}
    33      children={children}
    34      location={state.location}
    35      navigationType={state.action}
    36      navigator={history}
    37    /&gt;
    38  );
    39}
    40const CustomRouter = ({ history, ...props }) =&gt; {
    41  const [state, setState] = useState({
    42    action: history.action,
    43    location: history.location
    44  });
    45
    46  useLayoutEffect(() =&gt; history.listen(setState), [history]);
    47
    48  return (
    49    &lt;Router
    50      {...props}
    51      location={state.location}
    52      navigationType={state.action}
    53      navigator={history}
    54    /&gt;
    55  );
    56};
    57

    This effectively proxies the custom history object into the Router and manages the navigation state.

    From here you swap in the CustomRouter with custom history object for the existing Router imported from react-router-dom.

    1import { createBrowserHistory } from &quot;history&quot;;
    2export const history = createBrowserHistory();
    3import { Router, Switch, Route, Link } from &quot;react-router-dom&quot;;
    4&lt;Router history={history}&gt;
    5 ... my routes
    6&lt;/Router&gt;
    7   // store action
    8    logout() {
    9        this.user = null;
    10        history.push('/');
    11    }
    12export function BrowserRouter({
    13  basename,
    14  children,
    15  window
    16}: BrowserRouterProps) {
    17  let historyRef = React.useRef&lt;BrowserHistory&gt;();
    18  if (historyRef.current == null) {
    19    historyRef.current = createBrowserHistory({ window });
    20  }
    21
    22  let history = historyRef.current;
    23  let [state, setState] = React.useState({
    24    action: history.action,
    25    location: history.location
    26  });
    27
    28  React.useLayoutEffect(() =&gt; history.listen(setState), [history]);
    29
    30  return (
    31    &lt;Router
    32      basename={basename}
    33      children={children}
    34      location={state.location}
    35      navigationType={state.action}
    36      navigator={history}
    37    /&gt;
    38  );
    39}
    40const CustomRouter = ({ history, ...props }) =&gt; {
    41  const [state, setState] = useState({
    42    action: history.action,
    43    location: history.location
    44  });
    45
    46  useLayoutEffect(() =&gt; history.listen(setState), [history]);
    47
    48  return (
    49    &lt;Router
    50      {...props}
    51      location={state.location}
    52      navigationType={state.action}
    53      navigator={history}
    54    /&gt;
    55  );
    56};
    57export default function App() {
    58  return (
    59    &lt;CustomRouter  history={history}&gt;
    60      &lt;div className=&quot;App&quot;&gt;
    61        &lt;Routes&gt;
    62          &lt;Route path=&quot;/&quot; element={&lt;Home /&gt;} /&gt;
    63          &lt;Route path=&quot;/profile&quot; element={&lt;Profile /&gt;} /&gt;
    64        &lt;/Routes&gt;
    65      &lt;/div&gt;
    66    &lt;/CustomRouter&gt;
    67  );
    68}
    69

    Fork of your codesandbox:

    Edit react-router-v6-navigate-outside-of-components

    Source https://stackoverflow.com/questions/69871987

    QUESTION

    The unauthenticated git protocol on port 9418 is no longer supported

    Asked 2022-Mar-27 at 13:23

    I have been using github actions for quite sometime but today my deployments started failing. Below is the error from github action logs

    1Command: git
    2Arguments: ls-remote --tags --heads git://github.com/adobe-webplatform/eve.git
    3Directory: /home/runner/work/stackstream-fe/stackstream-fe
    4Output:
    5fatal: remote error: 
    6  The unauthenticated git protocol on port 9418 is no longer supported.
    7

    Upon investigation, it appears that below section in my yml file is causing the issue.

    1Command: git
    2Arguments: ls-remote --tags --heads git://github.com/adobe-webplatform/eve.git
    3Directory: /home/runner/work/stackstream-fe/stackstream-fe
    4Output:
    5fatal: remote error: 
    6  The unauthenticated git protocol on port 9418 is no longer supported.
    7    - name: Installing modules
    8      run: yarn install
    9

    I have looked into this change log but can't seem to comprehend the issue.

    Additional Details: Server: EC2 Instance Github actions steps:

    1Command: git
    2Arguments: ls-remote --tags --heads git://github.com/adobe-webplatform/eve.git
    3Directory: /home/runner/work/stackstream-fe/stackstream-fe
    4Output:
    5fatal: remote error: 
    6  The unauthenticated git protocol on port 9418 is no longer supported.
    7    - name: Installing modules
    8      run: yarn install
    9  steps:
    10  - name: Checkout
    11    uses: actions/checkout@v2
    12
    13  - id: vars
    14    run: |
    15      if [ '${{ github.ref }}' == 'refs/heads/master' ]; then echo &quot;::set-output name=environment::prod_stackstream&quot; ; echo &quot;::set-output name=api-url::api&quot; ; elif [ '${{ github.ref }}' == 'refs/heads/staging' ]; then echo &quot;::set-output name=environment::staging_stackstream&quot;  ; echo &quot;::set-output name=api-url::stagingapi&quot; ; else echo &quot;::set-output name=environment::dev_stackstream&quot; ; echo &quot;::set-output name=api-url::devapi&quot; ; fi
    16
    17  - uses: pCYSl5EDgo/cat@master
    18    id: slack
    19    with:
    20      path: .github/workflows/slack.txt
    21
    22  - name: Slack Start Notification
    23    uses: 8398a7/action-slack@v3
    24    env:
    25      SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
    26      ENVIRONMENT: '`${{ steps.vars.outputs.environment }}`'
    27      COLOR: good
    28      STATUS: '`Started`'
    29    with:
    30      status: custom
    31      fields: workflow,job,commit,repo,ref,author,took
    32      custom_payload: |
    33        ${{ steps.slack.outputs.text }}
    34
    35  - name: Installing modules
    36    env:
    37      REACT_APP_API_URL: 'https://${{ steps.vars.outputs.api-url }}mergestack.com/api/v1'
    38    run: yarn install
    39
    40  - name: Create Frontend Build
    41    env:
    42      REACT_APP_API_URL: 'https://${{ steps.vars.outputs.api-url }}mergestack.com/api/v1'
    43    run: yarn build
    44
    45  - name: Deploy to Frontend Server DEV
    46    if: ${{ contains(github.ref, 'dev') }}
    47    uses: easingthemes/ssh-deploy@v2.1.5
    48    env:
    49      SSH_PRIVATE_KEY: ${{ secrets.DEV_KEY }}
    50      ARGS: '-rltgoDzvO --delete'
    51      SOURCE: 'deploy/'
    52      REMOTE_HOST: ${{ secrets.DEV_HOST }}
    53      REMOTE_USER: plyfolio-dev
    54      TARGET: '/home/plyfolio-dev/${{ steps.vars.outputs.environment }}/fe/deploy'
    55

    package.json file

    1Command: git
    2Arguments: ls-remote --tags --heads git://github.com/adobe-webplatform/eve.git
    3Directory: /home/runner/work/stackstream-fe/stackstream-fe
    4Output:
    5fatal: remote error: 
    6  The unauthenticated git protocol on port 9418 is no longer supported.
    7    - name: Installing modules
    8      run: yarn install
    9  steps:
    10  - name: Checkout
    11    uses: actions/checkout@v2
    12
    13  - id: vars
    14    run: |
    15      if [ '${{ github.ref }}' == 'refs/heads/master' ]; then echo &quot;::set-output name=environment::prod_stackstream&quot; ; echo &quot;::set-output name=api-url::api&quot; ; elif [ '${{ github.ref }}' == 'refs/heads/staging' ]; then echo &quot;::set-output name=environment::staging_stackstream&quot;  ; echo &quot;::set-output name=api-url::stagingapi&quot; ; else echo &quot;::set-output name=environment::dev_stackstream&quot; ; echo &quot;::set-output name=api-url::devapi&quot; ; fi
    16
    17  - uses: pCYSl5EDgo/cat@master
    18    id: slack
    19    with:
    20      path: .github/workflows/slack.txt
    21
    22  - name: Slack Start Notification
    23    uses: 8398a7/action-slack@v3
    24    env:
    25      SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
    26      ENVIRONMENT: '`${{ steps.vars.outputs.environment }}`'
    27      COLOR: good
    28      STATUS: '`Started`'
    29    with:
    30      status: custom
    31      fields: workflow,job,commit,repo,ref,author,took
    32      custom_payload: |
    33        ${{ steps.slack.outputs.text }}
    34
    35  - name: Installing modules
    36    env:
    37      REACT_APP_API_URL: 'https://${{ steps.vars.outputs.api-url }}mergestack.com/api/v1'
    38    run: yarn install
    39
    40  - name: Create Frontend Build
    41    env:
    42      REACT_APP_API_URL: 'https://${{ steps.vars.outputs.api-url }}mergestack.com/api/v1'
    43    run: yarn build
    44
    45  - name: Deploy to Frontend Server DEV
    46    if: ${{ contains(github.ref, 'dev') }}
    47    uses: easingthemes/ssh-deploy@v2.1.5
    48    env:
    49      SSH_PRIVATE_KEY: ${{ secrets.DEV_KEY }}
    50      ARGS: '-rltgoDzvO --delete'
    51      SOURCE: 'deploy/'
    52      REMOTE_HOST: ${{ secrets.DEV_HOST }}
    53      REMOTE_USER: plyfolio-dev
    54      TARGET: '/home/plyfolio-dev/${{ steps.vars.outputs.environment }}/fe/deploy'
    55   {
    56  &quot;name&quot;: &quot;stackstream-fe&quot;,
    57  &quot;version&quot;: &quot;1.0.0&quot;,
    58  &quot;authors&quot;: [
    59    &quot;fayyaznofal@gmail.com&quot;
    60  ],
    61  &quot;private&quot;: true,
    62  &quot;dependencies&quot;: {
    63    &quot;@fortawesome/fontawesome-svg-core&quot;: &quot;^1.2.34&quot;,
    64    &quot;@fortawesome/free-solid-svg-icons&quot;: &quot;^5.15.2&quot;,
    65    &quot;@fortawesome/react-fontawesome&quot;: &quot;^0.1.14&quot;,
    66    &quot;@fullcalendar/bootstrap&quot;: &quot;^5.5.0&quot;,
    67    &quot;@fullcalendar/core&quot;: &quot;^5.5.0&quot;,
    68    &quot;@fullcalendar/daygrid&quot;: &quot;^5.5.0&quot;,
    69    &quot;@fullcalendar/interaction&quot;: &quot;^5.5.0&quot;,
    70    &quot;@fullcalendar/react&quot;: &quot;^5.5.0&quot;,
    71    &quot;@lourenci/react-kanban&quot;: &quot;^2.1.0&quot;,
    72    &quot;@redux-saga/simple-saga-monitor&quot;: &quot;^1.1.2&quot;,
    73    &quot;@testing-library/jest-dom&quot;: &quot;^5.11.9&quot;,
    74    &quot;@testing-library/react&quot;: &quot;^11.2.3&quot;,
    75    &quot;@testing-library/user-event&quot;: &quot;^12.6.0&quot;,
    76    &quot;@toast-ui/react-chart&quot;: &quot;^1.0.2&quot;,
    77    &quot;@types/jest&quot;: &quot;^26.0.14&quot;,
    78    &quot;@types/node&quot;: &quot;^14.10.3&quot;,
    79    &quot;@types/react&quot;: &quot;^16.9.49&quot;,
    80    &quot;@types/react-dom&quot;: &quot;^16.9.8&quot;,
    81    &quot;@vtaits/react-color-picker&quot;: &quot;^0.1.1&quot;,
    82    &quot;apexcharts&quot;: &quot;^3.23.1&quot;,
    83    &quot;availity-reactstrap-validation&quot;: &quot;^2.7.0&quot;,
    84    &quot;axios&quot;: &quot;^0.21.1&quot;,
    85    &quot;axios-mock-adapter&quot;: &quot;^1.19.0&quot;,
    86    &quot;axios-progress-bar&quot;: &quot;^1.2.0&quot;,
    87    &quot;bootstrap&quot;: &quot;^5.0.0-beta2&quot;,
    88    &quot;chart.js&quot;: &quot;^2.9.4&quot;,
    89    &quot;chartist&quot;: &quot;^0.11.4&quot;,
    90    &quot;classnames&quot;: &quot;^2.2.6&quot;,
    91    &quot;components&quot;: &quot;^0.1.0&quot;,
    92    &quot;dotenv&quot;: &quot;^8.2.0&quot;,
    93    &quot;draft-js&quot;: &quot;^0.11.7&quot;,
    94    &quot;echarts&quot;: &quot;^4.9.0&quot;,
    95    &quot;echarts-for-react&quot;: &quot;^2.0.16&quot;,
    96    &quot;firebase&quot;: &quot;^8.2.3&quot;,
    97    &quot;google-maps-react&quot;: &quot;^2.0.6&quot;,
    98    &quot;history&quot;: &quot;^4.10.1&quot;,
    99    &quot;i&quot;: &quot;^0.3.6&quot;,
    100    &quot;i18next&quot;: &quot;^19.8.4&quot;,
    101    &quot;i18next-browser-languagedetector&quot;: &quot;^6.0.1&quot;,
    102    &quot;jsonwebtoken&quot;: &quot;^8.5.1&quot;,
    103    &quot;leaflet&quot;: &quot;^1.7.1&quot;,
    104    &quot;lodash&quot;: &quot;^4.17.21&quot;,
    105    &quot;lodash.clonedeep&quot;: &quot;^4.5.0&quot;,
    106    &quot;lodash.get&quot;: &quot;^4.4.2&quot;,
    107    &quot;metismenujs&quot;: &quot;^1.2.1&quot;,
    108    &quot;mkdirp&quot;: &quot;^1.0.4&quot;,
    109    &quot;moment&quot;: &quot;2.29.1&quot;,
    110    &quot;moment-timezone&quot;: &quot;^0.5.32&quot;,
    111    &quot;nouislider-react&quot;: &quot;^3.3.9&quot;,
    112    &quot;npm&quot;: &quot;^7.6.3&quot;,
    113    &quot;prop-types&quot;: &quot;^15.7.2&quot;,
    114    &quot;query-string&quot;: &quot;^6.14.0&quot;,
    115    &quot;react&quot;: &quot;^16.13.1&quot;,
    116    &quot;react-apexcharts&quot;: &quot;^1.3.7&quot;,
    117    &quot;react-auth-code-input&quot;: &quot;^1.0.0&quot;,
    118    &quot;react-avatar&quot;: &quot;^3.10.0&quot;,
    119    &quot;react-bootstrap&quot;: &quot;^1.5.0&quot;,
    120    &quot;react-bootstrap-editable&quot;: &quot;^0.8.2&quot;,
    121    &quot;react-bootstrap-sweetalert&quot;: &quot;^5.2.0&quot;,
    122    &quot;react-bootstrap-table-next&quot;: &quot;^4.0.3&quot;,
    123    &quot;react-bootstrap-table2-editor&quot;: &quot;^1.4.0&quot;,
    124    &quot;react-bootstrap-table2-paginator&quot;: &quot;^2.1.2&quot;,
    125    &quot;react-bootstrap-table2-toolkit&quot;: &quot;^2.1.3&quot;,
    126    &quot;react-chartist&quot;: &quot;^0.14.3&quot;,
    127    &quot;react-chartjs-2&quot;: &quot;^2.11.1&quot;,
    128    &quot;react-color&quot;: &quot;^2.19.3&quot;,
    129    &quot;react-confirm-alert&quot;: &quot;^2.7.0&quot;,
    130    &quot;react-content-loader&quot;: &quot;^6.0.1&quot;,
    131    &quot;react-countdown&quot;: &quot;^2.3.1&quot;,
    132    &quot;react-countup&quot;: &quot;^4.3.3&quot;,
    133    &quot;react-cropper&quot;: &quot;^2.1.4&quot;,
    134    &quot;react-data-table-component&quot;: &quot;^6.11.8&quot;,
    135    &quot;react-date-picker&quot;: &quot;^8.0.6&quot;,
    136    &quot;react-datepicker&quot;: &quot;^3.4.1&quot;,
    137    &quot;react-dom&quot;: &quot;^16.13.1&quot;,
    138    &quot;react-draft-wysiwyg&quot;: &quot;^1.14.5&quot;,
    139    &quot;react-drag-listview&quot;: &quot;^0.1.8&quot;,
    140    &quot;react-drawer&quot;: &quot;^1.3.4&quot;,
    141    &quot;react-dropzone&quot;: &quot;^11.2.4&quot;,
    142    &quot;react-dual-listbox&quot;: &quot;^2.0.0&quot;,
    143    &quot;react-facebook-login&quot;: &quot;^4.1.1&quot;,
    144    &quot;react-flatpickr&quot;: &quot;^3.10.6&quot;,
    145    &quot;react-google-login&quot;: &quot;^5.2.2&quot;,
    146    &quot;react-hook-form&quot;: &quot;^7.15.2&quot;,
    147    &quot;react-i18next&quot;: &quot;^11.8.5&quot;,
    148    &quot;react-icons&quot;: &quot;^4.2.0&quot;,
    149    &quot;react-image-lightbox&quot;: &quot;^5.1.1&quot;,
    150    &quot;react-input-mask&quot;: &quot;^2.0.4&quot;,
    151    &quot;react-jvectormap&quot;: &quot;^0.0.16&quot;,
    152    &quot;react-leaflet&quot;: &quot;^3.0.5&quot;,
    153    &quot;react-meta-tags&quot;: &quot;^1.0.1&quot;,
    154    &quot;react-modal-video&quot;: &quot;^1.2.6&quot;,
    155    &quot;react-notifications&quot;: &quot;^1.7.2&quot;,
    156    &quot;react-number-format&quot;: &quot;^4.7.3&quot;,
    157    &quot;react-perfect-scrollbar&quot;: &quot;^1.5.8&quot;,
    158    &quot;react-rangeslider&quot;: &quot;^2.2.0&quot;,
    159    &quot;react-rating&quot;: &quot;^2.0.5&quot;,
    160    &quot;react-rating-tooltip&quot;: &quot;^1.1.6&quot;,
    161    &quot;react-redux&quot;: &quot;^7.2.1&quot;,
    162    &quot;react-responsive-carousel&quot;: &quot;^3.2.11&quot;,
    163    &quot;react-router-dom&quot;: &quot;^5.2.0&quot;,
    164    &quot;react-script&quot;: &quot;^2.0.5&quot;,
    165    &quot;react-scripts&quot;: &quot;3.4.3&quot;,
    166    &quot;react-select&quot;: &quot;^4.3.1&quot;,
    167    &quot;react-sparklines&quot;: &quot;^1.7.0&quot;,
    168    &quot;react-star-ratings&quot;: &quot;^2.3.0&quot;,
    169    &quot;react-super-responsive-table&quot;: &quot;^5.2.0&quot;,
    170    &quot;react-switch&quot;: &quot;^6.0.0&quot;,
    171    &quot;react-table&quot;: &quot;^7.6.3&quot;,
    172    &quot;react-toastify&quot;: &quot;^7.0.3&quot;,
    173    &quot;react-toastr&quot;: &quot;^3.0.0&quot;,
    174    &quot;react-twitter-auth&quot;: &quot;0.0.13&quot;,
    175    &quot;reactstrap&quot;: &quot;^8.8.1&quot;,
    176    &quot;recharts&quot;: &quot;^2.0.8&quot;,
    177    &quot;redux&quot;: &quot;^4.0.5&quot;,
    178    &quot;redux-saga&quot;: &quot;^1.1.3&quot;,
    179    &quot;reselect&quot;: &quot;^4.0.0&quot;,
    180    &quot;sass&quot;: &quot;^1.37.5&quot;,
    181    &quot;simplebar-react&quot;: &quot;^2.3.0&quot;,
    182    &quot;styled&quot;: &quot;^1.0.0&quot;,
    183    &quot;styled-components&quot;: &quot;^5.2.1&quot;,
    184    &quot;toastr&quot;: &quot;^2.1.4&quot;,
    185    &quot;typescript&quot;: &quot;^4.0.2&quot;,
    186    &quot;universal-cookie&quot;: &quot;^4.0.4&quot;
    187  },
    188  &quot;devDependencies&quot;: {
    189    &quot;@typescript-eslint/eslint-plugin&quot;: &quot;^2.27.0&quot;,
    190    &quot;@typescript-eslint/parser&quot;: &quot;^2.27.0&quot;,
    191    &quot;@typescript-eslint/typescript-estree&quot;: &quot;^4.15.2&quot;,
    192    &quot;eslint-config-prettier&quot;: &quot;^6.10.1&quot;,
    193    &quot;eslint-plugin-prettier&quot;: &quot;^3.1.2&quot;,
    194    &quot;husky&quot;: &quot;^4.2.5&quot;,
    195    &quot;lint-staged&quot;: &quot;^10.1.3&quot;,
    196    &quot;prettier&quot;: &quot;^1.19.1&quot;,
    197    &quot;react-test-renderer&quot;: &quot;^16.13.1&quot;,
    198    &quot;redux-devtools-extension&quot;: &quot;^2.13.8&quot;,
    199    &quot;redux-mock-store&quot;: &quot;^1.5.4&quot;
    200  },
    201  &quot;scripts&quot;: {
    202    &quot;start&quot;: &quot;react-scripts start&quot;,
    203    &quot;build&quot;: &quot;react-scripts build &amp;&amp; mv build ./deploy/build&quot;,
    204    &quot;build-local&quot;: &quot;react-scripts build&quot;,
    205    &quot;test&quot;: &quot;react-scripts test&quot;,
    206    &quot;eject&quot;: &quot;react-scripts eject&quot;
    207  },
    208  &quot;eslintConfig&quot;: {
    209    &quot;extends&quot;: &quot;react-app&quot;
    210  },
    211  &quot;husky&quot;: {
    212    &quot;hooks&quot;: {
    213      &quot;pre-commit&quot;: &quot;lint-staged&quot;
    214    }
    215  },
    216  &quot;lint-staged&quot;: {
    217    &quot;*.{js,ts,tsx}&quot;: [
    218      &quot;eslint --fix&quot;
    219    ]
    220  },
    221  &quot;browserslist&quot;: {
    222    &quot;production&quot;: [
    223      &quot;&gt;0.2%&quot;,
    224      &quot;not dead&quot;,
    225      &quot;not op_mini all&quot;
    226    ],
    227    &quot;development&quot;: [
    228      &quot;last 1 chrome version&quot;,
    229      &quot;last 1 firefox version&quot;,
    230      &quot;last 1 safari version&quot;
    231    ]
    232  }
    233}
    234

    ANSWER

    Answered 2022-Mar-16 at 07:01

    First, this error message is indeed expected on Jan. 11th, 2022.
    See "Improving Git protocol security on GitHub".

    January 11, 2022 Final brownout.

    This is the full brownout period where we’ll temporarily stop accepting the deprecated key and signature types, ciphers, and MACs, and the unencrypted Git protocol.
    This will help clients discover any lingering use of older keys or old URLs.

    Second, check your package.json dependencies for any git:// URL, as in this example, fixed in this PR.

    As noted by Jörg W Mittag:

    There was a 4-month warning.
    The entire Internet has been moving away from unauthenticated, unencrypted protocols for a decade, it's not like this is a huge surprise.

    Personally, I consider it less an "issue" and more "detecting unmaintained dependencies".

    Plus, this is still only the brownout period, so the protocol will only be disabled for a short period of time, allowing developers to discover the problem.

    The permanent shutdown is not until March 15th.


    For GitHub Actions:

    As in actions/checkout issue 14, you can add as a first step:

    1Command: git
    2Arguments: ls-remote --tags --heads git://github.com/adobe-webplatform/eve.git
    3Directory: /home/runner/work/stackstream-fe/stackstream-fe
    4Output:
    5fatal: remote error: 
    6  The unauthenticated git protocol on port 9418 is no longer supported.
    7    - name: Installing modules
    8      run: yarn install
    9  steps:
    10  - name: Checkout
    11    uses: actions/checkout@v2
    12
    13  - id: vars
    14    run: |
    15      if [ '${{ github.ref }}' == 'refs/heads/master' ]; then echo &quot;::set-output name=environment::prod_stackstream&quot; ; echo &quot;::set-output name=api-url::api&quot; ; elif [ '${{ github.ref }}' == 'refs/heads/staging' ]; then echo &quot;::set-output name=environment::staging_stackstream&quot;  ; echo &quot;::set-output name=api-url::stagingapi&quot; ; else echo &quot;::set-output name=environment::dev_stackstream&quot; ; echo &quot;::set-output name=api-url::devapi&quot; ; fi
    16
    17  - uses: pCYSl5EDgo/cat@master
    18    id: slack
    19    with:
    20      path: .github/workflows/slack.txt
    21
    22  - name: Slack Start Notification
    23    uses: 8398a7/action-slack@v3
    24    env:
    25      SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
    26      ENVIRONMENT: '`${{ steps.vars.outputs.environment }}`'
    27      COLOR: good
    28      STATUS: '`Started`'
    29    with:
    30      status: custom
    31      fields: workflow,job,commit,repo,ref,author,took
    32      custom_payload: |
    33        ${{ steps.slack.outputs.text }}
    34
    35  - name: Installing modules
    36    env:
    37      REACT_APP_API_URL: 'https://${{ steps.vars.outputs.api-url }}mergestack.com/api/v1'
    38    run: yarn install
    39
    40  - name: Create Frontend Build
    41    env:
    42      REACT_APP_API_URL: 'https://${{ steps.vars.outputs.api-url }}mergestack.com/api/v1'
    43    run: yarn build
    44
    45  - name: Deploy to Frontend Server DEV
    46    if: ${{ contains(github.ref, 'dev') }}
    47    uses: easingthemes/ssh-deploy@v2.1.5
    48    env:
    49      SSH_PRIVATE_KEY: ${{ secrets.DEV_KEY }}
    50      ARGS: '-rltgoDzvO --delete'
    51      SOURCE: 'deploy/'
    52      REMOTE_HOST: ${{ secrets.DEV_HOST }}
    53      REMOTE_USER: plyfolio-dev
    54      TARGET: '/home/plyfolio-dev/${{ steps.vars.outputs.environment }}/fe/deploy'
    55   {
    56  &quot;name&quot;: &quot;stackstream-fe&quot;,
    57  &quot;version&quot;: &quot;1.0.0&quot;,
    58  &quot;authors&quot;: [
    59    &quot;fayyaznofal@gmail.com&quot;
    60  ],
    61  &quot;private&quot;: true,
    62  &quot;dependencies&quot;: {
    63    &quot;@fortawesome/fontawesome-svg-core&quot;: &quot;^1.2.34&quot;,
    64    &quot;@fortawesome/free-solid-svg-icons&quot;: &quot;^5.15.2&quot;,
    65    &quot;@fortawesome/react-fontawesome&quot;: &quot;^0.1.14&quot;,
    66    &quot;@fullcalendar/bootstrap&quot;: &quot;^5.5.0&quot;,
    67    &quot;@fullcalendar/core&quot;: &quot;^5.5.0&quot;,
    68    &quot;@fullcalendar/daygrid&quot;: &quot;^5.5.0&quot;,
    69    &quot;@fullcalendar/interaction&quot;: &quot;^5.5.0&quot;,
    70    &quot;@fullcalendar/react&quot;: &quot;^5.5.0&quot;,
    71    &quot;@lourenci/react-kanban&quot;: &quot;^2.1.0&quot;,
    72    &quot;@redux-saga/simple-saga-monitor&quot;: &quot;^1.1.2&quot;,
    73    &quot;@testing-library/jest-dom&quot;: &quot;^5.11.9&quot;,
    74    &quot;@testing-library/react&quot;: &quot;^11.2.3&quot;,
    75    &quot;@testing-library/user-event&quot;: &quot;^12.6.0&quot;,
    76    &quot;@toast-ui/react-chart&quot;: &quot;^1.0.2&quot;,
    77    &quot;@types/jest&quot;: &quot;^26.0.14&quot;,
    78    &quot;@types/node&quot;: &quot;^14.10.3&quot;,
    79    &quot;@types/react&quot;: &quot;^16.9.49&quot;,
    80    &quot;@types/react-dom&quot;: &quot;^16.9.8&quot;,
    81    &quot;@vtaits/react-color-picker&quot;: &quot;^0.1.1&quot;,
    82    &quot;apexcharts&quot;: &quot;^3.23.1&quot;,
    83    &quot;availity-reactstrap-validation&quot;: &quot;^2.7.0&quot;,
    84    &quot;axios&quot;: &quot;^0.21.1&quot;,
    85    &quot;axios-mock-adapter&quot;: &quot;^1.19.0&quot;,
    86    &quot;axios-progress-bar&quot;: &quot;^1.2.0&quot;,
    87    &quot;bootstrap&quot;: &quot;^5.0.0-beta2&quot;,
    88    &quot;chart.js&quot;: &quot;^2.9.4&quot;,
    89    &quot;chartist&quot;: &quot;^0.11.4&quot;,
    90    &quot;classnames&quot;: &quot;^2.2.6&quot;,
    91    &quot;components&quot;: &quot;^0.1.0&quot;,
    92    &quot;dotenv&quot;: &quot;^8.2.0&quot;,
    93    &quot;draft-js&quot;: &quot;^0.11.7&quot;,
    94    &quot;echarts&quot;: &quot;^4.9.0&quot;,
    95    &quot;echarts-for-react&quot;: &quot;^2.0.16&quot;,
    96    &quot;firebase&quot;: &quot;^8.2.3&quot;,
    97    &quot;google-maps-react&quot;: &quot;^2.0.6&quot;,
    98    &quot;history&quot;: &quot;^4.10.1&quot;,
    99    &quot;i&quot;: &quot;^0.3.6&quot;,
    100    &quot;i18next&quot;: &quot;^19.8.4&quot;,
    101    &quot;i18next-browser-languagedetector&quot;: &quot;^6.0.1&quot;,
    102    &quot;jsonwebtoken&quot;: &quot;^8.5.1&quot;,
    103    &quot;leaflet&quot;: &quot;^1.7.1&quot;,
    104    &quot;lodash&quot;: &quot;^4.17.21&quot;,
    105    &quot;lodash.clonedeep&quot;: &quot;^4.5.0&quot;,
    106    &quot;lodash.get&quot;: &quot;^4.4.2&quot;,
    107    &quot;metismenujs&quot;: &quot;^1.2.1&quot;,
    108    &quot;mkdirp&quot;: &quot;^1.0.4&quot;,
    109    &quot;moment&quot;: &quot;2.29.1&quot;,
    110    &quot;moment-timezone&quot;: &quot;^0.5.32&quot;,
    111    &quot;nouislider-react&quot;: &quot;^3.3.9&quot;,
    112    &quot;npm&quot;: &quot;^7.6.3&quot;,
    113    &quot;prop-types&quot;: &quot;^15.7.2&quot;,
    114    &quot;query-string&quot;: &quot;^6.14.0&quot;,
    115    &quot;react&quot;: &quot;^16.13.1&quot;,
    116    &quot;react-apexcharts&quot;: &quot;^1.3.7&quot;,
    117    &quot;react-auth-code-input&quot;: &quot;^1.0.0&quot;,
    118    &quot;react-avatar&quot;: &quot;^3.10.0&quot;,
    119    &quot;react-bootstrap&quot;: &quot;^1.5.0&quot;,
    120    &quot;react-bootstrap-editable&quot;: &quot;^0.8.2&quot;,
    121    &quot;react-bootstrap-sweetalert&quot;: &quot;^5.2.0&quot;,
    122    &quot;react-bootstrap-table-next&quot;: &quot;^4.0.3&quot;,
    123    &quot;react-bootstrap-table2-editor&quot;: &quot;^1.4.0&quot;,
    124    &quot;react-bootstrap-table2-paginator&quot;: &quot;^2.1.2&quot;,
    125    &quot;react-bootstrap-table2-toolkit&quot;: &quot;^2.1.3&quot;,
    126    &quot;react-chartist&quot;: &quot;^0.14.3&quot;,
    127    &quot;react-chartjs-2&quot;: &quot;^2.11.1&quot;,
    128    &quot;react-color&quot;: &quot;^2.19.3&quot;,
    129    &quot;react-confirm-alert&quot;: &quot;^2.7.0&quot;,
    130    &quot;react-content-loader&quot;: &quot;^6.0.1&quot;,
    131    &quot;react-countdown&quot;: &quot;^2.3.1&quot;,
    132    &quot;react-countup&quot;: &quot;^4.3.3&quot;,
    133    &quot;react-cropper&quot;: &quot;^2.1.4&quot;,
    134    &quot;react-data-table-component&quot;: &quot;^6.11.8&quot;,
    135    &quot;react-date-picker&quot;: &quot;^8.0.6&quot;,
    136    &quot;react-datepicker&quot;: &quot;^3.4.1&quot;,
    137    &quot;react-dom&quot;: &quot;^16.13.1&quot;,
    138    &quot;react-draft-wysiwyg&quot;: &quot;^1.14.5&quot;,
    139    &quot;react-drag-listview&quot;: &quot;^0.1.8&quot;,
    140    &quot;react-drawer&quot;: &quot;^1.3.4&quot;,
    141    &quot;react-dropzone&quot;: &quot;^11.2.4&quot;,
    142    &quot;react-dual-listbox&quot;: &quot;^2.0.0&quot;,
    143    &quot;react-facebook-login&quot;: &quot;^4.1.1&quot;,
    144    &quot;react-flatpickr&quot;: &quot;^3.10.6&quot;,
    145    &quot;react-google-login&quot;: &quot;^5.2.2&quot;,
    146    &quot;react-hook-form&quot;: &quot;^7.15.2&quot;,
    147    &quot;react-i18next&quot;: &quot;^11.8.5&quot;,
    148    &quot;react-icons&quot;: &quot;^4.2.0&quot;,
    149    &quot;react-image-lightbox&quot;: &quot;^5.1.1&quot;,
    150    &quot;react-input-mask&quot;: &quot;^2.0.4&quot;,
    151    &quot;react-jvectormap&quot;: &quot;^0.0.16&quot;,
    152    &quot;react-leaflet&quot;: &quot;^3.0.5&quot;,
    153    &quot;react-meta-tags&quot;: &quot;^1.0.1&quot;,
    154    &quot;react-modal-video&quot;: &quot;^1.2.6&quot;,
    155    &quot;react-notifications&quot;: &quot;^1.7.2&quot;,
    156    &quot;react-number-format&quot;: &quot;^4.7.3&quot;,
    157    &quot;react-perfect-scrollbar&quot;: &quot;^1.5.8&quot;,
    158    &quot;react-rangeslider&quot;: &quot;^2.2.0&quot;,
    159    &quot;react-rating&quot;: &quot;^2.0.5&quot;,
    160    &quot;react-rating-tooltip&quot;: &quot;^1.1.6&quot;,
    161    &quot;react-redux&quot;: &quot;^7.2.1&quot;,
    162    &quot;react-responsive-carousel&quot;: &quot;^3.2.11&quot;,
    163    &quot;react-router-dom&quot;: &quot;^5.2.0&quot;,
    164    &quot;react-script&quot;: &quot;^2.0.5&quot;,
    165    &quot;react-scripts&quot;: &quot;3.4.3&quot;,
    166    &quot;react-select&quot;: &quot;^4.3.1&quot;,
    167    &quot;react-sparklines&quot;: &quot;^1.7.0&quot;,
    168    &quot;react-star-ratings&quot;: &quot;^2.3.0&quot;,
    169    &quot;react-super-responsive-table&quot;: &quot;^5.2.0&quot;,
    170    &quot;react-switch&quot;: &quot;^6.0.0&quot;,
    171    &quot;react-table&quot;: &quot;^7.6.3&quot;,
    172    &quot;react-toastify&quot;: &quot;^7.0.3&quot;,
    173    &quot;react-toastr&quot;: &quot;^3.0.0&quot;,
    174    &quot;react-twitter-auth&quot;: &quot;0.0.13&quot;,
    175    &quot;reactstrap&quot;: &quot;^8.8.1&quot;,
    176    &quot;recharts&quot;: &quot;^2.0.8&quot;,
    177    &quot;redux&quot;: &quot;^4.0.5&quot;,
    178    &quot;redux-saga&quot;: &quot;^1.1.3&quot;,
    179    &quot;reselect&quot;: &quot;^4.0.0&quot;,
    180    &quot;sass&quot;: &quot;^1.37.5&quot;,
    181    &quot;simplebar-react&quot;: &quot;^2.3.0&quot;,
    182    &quot;styled&quot;: &quot;^1.0.0&quot;,
    183    &quot;styled-components&quot;: &quot;^5.2.1&quot;,
    184    &quot;toastr&quot;: &quot;^2.1.4&quot;,
    185    &quot;typescript&quot;: &quot;^4.0.2&quot;,
    186    &quot;universal-cookie&quot;: &quot;^4.0.4&quot;
    187  },
    188  &quot;devDependencies&quot;: {
    189    &quot;@typescript-eslint/eslint-plugin&quot;: &quot;^2.27.0&quot;,
    190    &quot;@typescript-eslint/parser&quot;: &quot;^2.27.0&quot;,
    191    &quot;@typescript-eslint/typescript-estree&quot;: &quot;^4.15.2&quot;,
    192    &quot;eslint-config-prettier&quot;: &quot;^6.10.1&quot;,
    193    &quot;eslint-plugin-prettier&quot;: &quot;^3.1.2&quot;,
    194    &quot;husky&quot;: &quot;^4.2.5&quot;,
    195    &quot;lint-staged&quot;: &quot;^10.1.3&quot;,
    196    &quot;prettier&quot;: &quot;^1.19.1&quot;,
    197    &quot;react-test-renderer&quot;: &quot;^16.13.1&quot;,
    198    &quot;redux-devtools-extension&quot;: &quot;^2.13.8&quot;,
    199    &quot;redux-mock-store&quot;: &quot;^1.5.4&quot;
    200  },
    201  &quot;scripts&quot;: {
    202    &quot;start&quot;: &quot;react-scripts start&quot;,
    203    &quot;build&quot;: &quot;react-scripts build &amp;&amp; mv build ./deploy/build&quot;,
    204    &quot;build-local&quot;: &quot;react-scripts build&quot;,
    205    &quot;test&quot;: &quot;react-scripts test&quot;,
    206    &quot;eject&quot;: &quot;react-scripts eject&quot;
    207  },
    208  &quot;eslintConfig&quot;: {
    209    &quot;extends&quot;: &quot;react-app&quot;
    210  },
    211  &quot;husky&quot;: {
    212    &quot;hooks&quot;: {
    213      &quot;pre-commit&quot;: &quot;lint-staged&quot;
    214    }
    215  },
    216  &quot;lint-staged&quot;: {
    217    &quot;*.{js,ts,tsx}&quot;: [
    218      &quot;eslint --fix&quot;
    219    ]
    220  },
    221  &quot;browserslist&quot;: {
    222    &quot;production&quot;: [
    223      &quot;&gt;0.2%&quot;,
    224      &quot;not dead&quot;,
    225      &quot;not op_mini all&quot;
    226    ],
    227    &quot;development&quot;: [
    228      &quot;last 1 chrome version&quot;,
    229      &quot;last 1 firefox version&quot;,
    230      &quot;last 1 safari version&quot;
    231    ]
    232  }
    233}
    234    - name: Fix up git URLs
    235      run: echo -e '[url &quot;https://github.com/&quot;]\n  insteadOf = &quot;git://github.com/&quot;' &gt;&gt; ~/.gitconfig
    236

    That will change any git://github.com/ into https://github.com/.

    For local projects

    For all your repositories, you can set:

    1Command: git
    2Arguments: ls-remote --tags --heads git://github.com/adobe-webplatform/eve.git
    3Directory: /home/runner/work/stackstream-fe/stackstream-fe
    4Output:
    5fatal: remote error: 
    6  The unauthenticated git protocol on port 9418 is no longer supported.
    7    - name: Installing modules
    8      run: yarn install
    9  steps:
    10  - name: Checkout
    11    uses: actions/checkout@v2
    12
    13  - id: vars
    14    run: |
    15      if [ '${{ github.ref }}' == 'refs/heads/master' ]; then echo &quot;::set-output name=environment::prod_stackstream&quot; ; echo &quot;::set-output name=api-url::api&quot; ; elif [ '${{ github.ref }}' == 'refs/heads/staging' ]; then echo &quot;::set-output name=environment::staging_stackstream&quot;  ; echo &quot;::set-output name=api-url::stagingapi&quot; ; else echo &quot;::set-output name=environment::dev_stackstream&quot; ; echo &quot;::set-output name=api-url::devapi&quot; ; fi
    16
    17  - uses: pCYSl5EDgo/cat@master
    18    id: slack
    19    with:
    20      path: .github/workflows/slack.txt
    21
    22  - name: Slack Start Notification
    23    uses: 8398a7/action-slack@v3
    24    env:
    25      SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
    26      ENVIRONMENT: '`${{ steps.vars.outputs.environment }}`'
    27      COLOR: good
    28      STATUS: '`Started`'
    29    with:
    30      status: custom
    31      fields: workflow,job,commit,repo,ref,author,took
    32      custom_payload: |
    33        ${{ steps.slack.outputs.text }}
    34
    35  - name: Installing modules
    36    env:
    37      REACT_APP_API_URL: 'https://${{ steps.vars.outputs.api-url }}mergestack.com/api/v1'
    38    run: yarn install
    39
    40  - name: Create Frontend Build
    41    env:
    42      REACT_APP_API_URL: 'https://${{ steps.vars.outputs.api-url }}mergestack.com/api/v1'
    43    run: yarn build
    44
    45  - name: Deploy to Frontend Server DEV
    46    if: ${{ contains(github.ref, 'dev') }}
    47    uses: easingthemes/ssh-deploy@v2.1.5
    48    env:
    49      SSH_PRIVATE_KEY: ${{ secrets.DEV_KEY }}
    50      ARGS: '-rltgoDzvO --delete'
    51      SOURCE: 'deploy/'
    52      REMOTE_HOST: ${{ secrets.DEV_HOST }}
    53      REMOTE_USER: plyfolio-dev
    54      TARGET: '/home/plyfolio-dev/${{ steps.vars.outputs.environment }}/fe/deploy'
    55   {
    56  &quot;name&quot;: &quot;stackstream-fe&quot;,
    57  &quot;version&quot;: &quot;1.0.0&quot;,
    58  &quot;authors&quot;: [
    59    &quot;fayyaznofal@gmail.com&quot;
    60  ],
    61  &quot;private&quot;: true,
    62  &quot;dependencies&quot;: {
    63    &quot;@fortawesome/fontawesome-svg-core&quot;: &quot;^1.2.34&quot;,
    64    &quot;@fortawesome/free-solid-svg-icons&quot;: &quot;^5.15.2&quot;,
    65    &quot;@fortawesome/react-fontawesome&quot;: &quot;^0.1.14&quot;,
    66    &quot;@fullcalendar/bootstrap&quot;: &quot;^5.5.0&quot;,
    67    &quot;@fullcalendar/core&quot;: &quot;^5.5.0&quot;,
    68    &quot;@fullcalendar/daygrid&quot;: &quot;^5.5.0&quot;,
    69    &quot;@fullcalendar/interaction&quot;: &quot;^5.5.0&quot;,
    70    &quot;@fullcalendar/react&quot;: &quot;^5.5.0&quot;,
    71    &quot;@lourenci/react-kanban&quot;: &quot;^2.1.0&quot;,
    72    &quot;@redux-saga/simple-saga-monitor&quot;: &quot;^1.1.2&quot;,
    73    &quot;@testing-library/jest-dom&quot;: &quot;^5.11.9&quot;,
    74    &quot;@testing-library/react&quot;: &quot;^11.2.3&quot;,
    75    &quot;@testing-library/user-event&quot;: &quot;^12.6.0&quot;,
    76    &quot;@toast-ui/react-chart&quot;: &quot;^1.0.2&quot;,
    77    &quot;@types/jest&quot;: &quot;^26.0.14&quot;,
    78    &quot;@types/node&quot;: &quot;^14.10.3&quot;,
    79    &quot;@types/react&quot;: &quot;^16.9.49&quot;,
    80    &quot;@types/react-dom&quot;: &quot;^16.9.8&quot;,
    81    &quot;@vtaits/react-color-picker&quot;: &quot;^0.1.1&quot;,
    82    &quot;apexcharts&quot;: &quot;^3.23.1&quot;,
    83    &quot;availity-reactstrap-validation&quot;: &quot;^2.7.0&quot;,
    84    &quot;axios&quot;: &quot;^0.21.1&quot;,
    85    &quot;axios-mock-adapter&quot;: &quot;^1.19.0&quot;,
    86    &quot;axios-progress-bar&quot;: &quot;^1.2.0&quot;,
    87    &quot;bootstrap&quot;: &quot;^5.0.0-beta2&quot;,
    88    &quot;chart.js&quot;: &quot;^2.9.4&quot;,
    89    &quot;chartist&quot;: &quot;^0.11.4&quot;,
    90    &quot;classnames&quot;: &quot;^2.2.6&quot;,
    91    &quot;components&quot;: &quot;^0.1.0&quot;,
    92    &quot;dotenv&quot;: &quot;^8.2.0&quot;,
    93    &quot;draft-js&quot;: &quot;^0.11.7&quot;,
    94    &quot;echarts&quot;: &quot;^4.9.0&quot;,
    95    &quot;echarts-for-react&quot;: &quot;^2.0.16&quot;,
    96    &quot;firebase&quot;: &quot;^8.2.3&quot;,
    97    &quot;google-maps-react&quot;: &quot;^2.0.6&quot;,
    98    &quot;history&quot;: &quot;^4.10.1&quot;,
    99    &quot;i&quot;: &quot;^0.3.6&quot;,
    100    &quot;i18next&quot;: &quot;^19.8.4&quot;,
    101    &quot;i18next-browser-languagedetector&quot;: &quot;^6.0.1&quot;,
    102    &quot;jsonwebtoken&quot;: &quot;^8.5.1&quot;,
    103    &quot;leaflet&quot;: &quot;^1.7.1&quot;,
    104    &quot;lodash&quot;: &quot;^4.17.21&quot;,
    105    &quot;lodash.clonedeep&quot;: &quot;^4.5.0&quot;,
    106    &quot;lodash.get&quot;: &quot;^4.4.2&quot;,
    107    &quot;metismenujs&quot;: &quot;^1.2.1&quot;,
    108    &quot;mkdirp&quot;: &quot;^1.0.4&quot;,
    109    &quot;moment&quot;: &quot;2.29.1&quot;,
    110    &quot;moment-timezone&quot;: &quot;^0.5.32&quot;,
    111    &quot;nouislider-react&quot;: &quot;^3.3.9&quot;,
    112    &quot;npm&quot;: &quot;^7.6.3&quot;,
    113    &quot;prop-types&quot;: &quot;^15.7.2&quot;,
    114    &quot;query-string&quot;: &quot;^6.14.0&quot;,
    115    &quot;react&quot;: &quot;^16.13.1&quot;,
    116    &quot;react-apexcharts&quot;: &quot;^1.3.7&quot;,
    117    &quot;react-auth-code-input&quot;: &quot;^1.0.0&quot;,
    118    &quot;react-avatar&quot;: &quot;^3.10.0&quot;,
    119    &quot;react-bootstrap&quot;: &quot;^1.5.0&quot;,
    120    &quot;react-bootstrap-editable&quot;: &quot;^0.8.2&quot;,
    121    &quot;react-bootstrap-sweetalert&quot;: &quot;^5.2.0&quot;,
    122    &quot;react-bootstrap-table-next&quot;: &quot;^4.0.3&quot;,
    123    &quot;react-bootstrap-table2-editor&quot;: &quot;^1.4.0&quot;,
    124    &quot;react-bootstrap-table2-paginator&quot;: &quot;^2.1.2&quot;,
    125    &quot;react-bootstrap-table2-toolkit&quot;: &quot;^2.1.3&quot;,
    126    &quot;react-chartist&quot;: &quot;^0.14.3&quot;,
    127    &quot;react-chartjs-2&quot;: &quot;^2.11.1&quot;,
    128    &quot;react-color&quot;: &quot;^2.19.3&quot;,
    129    &quot;react-confirm-alert&quot;: &quot;^2.7.0&quot;,
    130    &quot;react-content-loader&quot;: &quot;^6.0.1&quot;,
    131    &quot;react-countdown&quot;: &quot;^2.3.1&quot;,
    132    &quot;react-countup&quot;: &quot;^4.3.3&quot;,
    133    &quot;react-cropper&quot;: &quot;^2.1.4&quot;,
    134    &quot;react-data-table-component&quot;: &quot;^6.11.8&quot;,
    135    &quot;react-date-picker&quot;: &quot;^8.0.6&quot;,
    136    &quot;react-datepicker&quot;: &quot;^3.4.1&quot;,
    137    &quot;react-dom&quot;: &quot;^16.13.1&quot;,
    138    &quot;react-draft-wysiwyg&quot;: &quot;^1.14.5&quot;,
    139    &quot;react-drag-listview&quot;: &quot;^0.1.8&quot;,
    140    &quot;react-drawer&quot;: &quot;^1.3.4&quot;,
    141    &quot;react-dropzone&quot;: &quot;^11.2.4&quot;,
    142    &quot;react-dual-listbox&quot;: &quot;^2.0.0&quot;,
    143    &quot;react-facebook-login&quot;: &quot;^4.1.1&quot;,
    144    &quot;react-flatpickr&quot;: &quot;^3.10.6&quot;,
    145    &quot;react-google-login&quot;: &quot;^5.2.2&quot;,
    146    &quot;react-hook-form&quot;: &quot;^7.15.2&quot;,
    147    &quot;react-i18next&quot;: &quot;^11.8.5&quot;,
    148    &quot;react-icons&quot;: &quot;^4.2.0&quot;,
    149    &quot;react-image-lightbox&quot;: &quot;^5.1.1&quot;,
    150    &quot;react-input-mask&quot;: &quot;^2.0.4&quot;,
    151    &quot;react-jvectormap&quot;: &quot;^0.0.16&quot;,
    152    &quot;react-leaflet&quot;: &quot;^3.0.5&quot;,
    153    &quot;react-meta-tags&quot;: &quot;^1.0.1&quot;,
    154    &quot;react-modal-video&quot;: &quot;^1.2.6&quot;,
    155    &quot;react-notifications&quot;: &quot;^1.7.2&quot;,
    156    &quot;react-number-format&quot;: &quot;^4.7.3&quot;,
    157    &quot;react-perfect-scrollbar&quot;: &quot;^1.5.8&quot;,
    158    &quot;react-rangeslider&quot;: &quot;^2.2.0&quot;,
    159    &quot;react-rating&quot;: &quot;^2.0.5&quot;,
    160    &quot;react-rating-tooltip&quot;: &quot;^1.1.6&quot;,
    161    &quot;react-redux&quot;: &quot;^7.2.1&quot;,
    162    &quot;react-responsive-carousel&quot;: &quot;^3.2.11&quot;,
    163    &quot;react-router-dom&quot;: &quot;^5.2.0&quot;,
    164    &quot;react-script&quot;: &quot;^2.0.5&quot;,
    165    &quot;react-scripts&quot;: &quot;3.4.3&quot;,
    166    &quot;react-select&quot;: &quot;^4.3.1&quot;,
    167    &quot;react-sparklines&quot;: &quot;^1.7.0&quot;,
    168    &quot;react-star-ratings&quot;: &quot;^2.3.0&quot;,
    169    &quot;react-super-responsive-table&quot;: &quot;^5.2.0&quot;,
    170    &quot;react-switch&quot;: &quot;^6.0.0&quot;,
    171    &quot;react-table&quot;: &quot;^7.6.3&quot;,
    172    &quot;react-toastify&quot;: &quot;^7.0.3&quot;,
    173    &quot;react-toastr&quot;: &quot;^3.0.0&quot;,
    174    &quot;react-twitter-auth&quot;: &quot;0.0.13&quot;,
    175    &quot;reactstrap&quot;: &quot;^8.8.1&quot;,
    176    &quot;recharts&quot;: &quot;^2.0.8&quot;,
    177    &quot;redux&quot;: &quot;^4.0.5&quot;,
    178    &quot;redux-saga&quot;: &quot;^1.1.3&quot;,
    179    &quot;reselect&quot;: &quot;^4.0.0&quot;,
    180    &quot;sass&quot;: &quot;^1.37.5&quot;,
    181    &quot;simplebar-react&quot;: &quot;^2.3.0&quot;,
    182    &quot;styled&quot;: &quot;^1.0.0&quot;,
    183    &quot;styled-components&quot;: &quot;^5.2.1&quot;,
    184    &quot;toastr&quot;: &quot;^2.1.4&quot;,
    185    &quot;typescript&quot;: &quot;^4.0.2&quot;,
    186    &quot;universal-cookie&quot;: &quot;^4.0.4&quot;
    187  },
    188  &quot;devDependencies&quot;: {
    189    &quot;@typescript-eslint/eslint-plugin&quot;: &quot;^2.27.0&quot;,
    190    &quot;@typescript-eslint/parser&quot;: &quot;^2.27.0&quot;,
    191    &quot;@typescript-eslint/typescript-estree&quot;: &quot;^4.15.2&quot;,
    192    &quot;eslint-config-prettier&quot;: &quot;^6.10.1&quot;,
    193    &quot;eslint-plugin-prettier&quot;: &quot;^3.1.2&quot;,
    194    &quot;husky&quot;: &quot;^4.2.5&quot;,
    195    &quot;lint-staged&quot;: &quot;^10.1.3&quot;,
    196    &quot;prettier&quot;: &quot;^1.19.1&quot;,
    197    &quot;react-test-renderer&quot;: &quot;^16.13.1&quot;,
    198    &quot;redux-devtools-extension&quot;: &quot;^2.13.8&quot;,
    199    &quot;redux-mock-store&quot;: &quot;^1.5.4&quot;
    200  },
    201  &quot;scripts&quot;: {
    202    &quot;start&quot;: &quot;react-scripts start&quot;,
    203    &quot;build&quot;: &quot;react-scripts build &amp;&amp; mv build ./deploy/build&quot;,
    204    &quot;build-local&quot;: &quot;react-scripts build&quot;,
    205    &quot;test&quot;: &quot;react-scripts test&quot;,
    206    &quot;eject&quot;: &quot;react-scripts eject&quot;
    207  },
    208  &quot;eslintConfig&quot;: {
    209    &quot;extends&quot;: &quot;react-app&quot;
    210  },
    211  &quot;husky&quot;: {
    212    &quot;hooks&quot;: {
    213      &quot;pre-commit&quot;: &quot;lint-staged&quot;
    214    }
    215  },
    216  &quot;lint-staged&quot;: {
    217    &quot;*.{js,ts,tsx}&quot;: [
    218      &quot;eslint --fix&quot;
    219    ]
    220  },
    221  &quot;browserslist&quot;: {
    222    &quot;production&quot;: [
    223      &quot;&gt;0.2%&quot;,
    224      &quot;not dead&quot;,
    225      &quot;not op_mini all&quot;
    226    ],
    227    &quot;development&quot;: [
    228      &quot;last 1 chrome version&quot;,
    229      &quot;last 1 firefox version&quot;,
    230      &quot;last 1 safari version&quot;
    231    ]
    232  }
    233}
    234    - name: Fix up git URLs
    235      run: echo -e '[url &quot;https://github.com/&quot;]\n  insteadOf = &quot;git://github.com/&quot;' &gt;&gt; ~/.gitconfig
    236git config --global url.&quot;https://github.com/&quot;.insteadOf git://github.com/
    237

    You can also use SSH, but GitHub Security reminds us that, as of March 15th, 2022, GitHub stopped accepting DSA keys. RSA keys uploaded after Nov 2, 2021 will work only with SHA-2 signatures.
    The deprecated MACs, ciphers, and unencrypted Git protocol are permanently disabled.

    So this (with the right key) would work:

    1Command: git
    2Arguments: ls-remote --tags --heads git://github.com/adobe-webplatform/eve.git
    3Directory: /home/runner/work/stackstream-fe/stackstream-fe
    4Output:
    5fatal: remote error: 
    6  The unauthenticated git protocol on port 9418 is no longer supported.
    7    - name: Installing modules
    8      run: yarn install
    9  steps:
    10  - name: Checkout
    11    uses: actions/checkout@v2
    12
    13  - id: vars
    14    run: |
    15      if [ '${{ github.ref }}' == 'refs/heads/master' ]; then echo &quot;::set-output name=environment::prod_stackstream&quot; ; echo &quot;::set-output name=api-url::api&quot; ; elif [ '${{ github.ref }}' == 'refs/heads/staging' ]; then echo &quot;::set-output name=environment::staging_stackstream&quot;  ; echo &quot;::set-output name=api-url::stagingapi&quot; ; else echo &quot;::set-output name=environment::dev_stackstream&quot; ; echo &quot;::set-output name=api-url::devapi&quot; ; fi
    16
    17  - uses: pCYSl5EDgo/cat@master
    18    id: slack
    19    with:
    20      path: .github/workflows/slack.txt
    21
    22  - name: Slack Start Notification
    23    uses: 8398a7/action-slack@v3
    24    env:
    25      SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
    26      ENVIRONMENT: '`${{ steps.vars.outputs.environment }}`'
    27      COLOR: good
    28      STATUS: '`Started`'
    29    with:
    30      status: custom
    31      fields: workflow,job,commit,repo,ref,author,took
    32      custom_payload: |
    33        ${{ steps.slack.outputs.text }}
    34
    35  - name: Installing modules
    36    env:
    37      REACT_APP_API_URL: 'https://${{ steps.vars.outputs.api-url }}mergestack.com/api/v1'
    38    run: yarn install
    39
    40  - name: Create Frontend Build
    41    env:
    42      REACT_APP_API_URL: 'https://${{ steps.vars.outputs.api-url }}mergestack.com/api/v1'
    43    run: yarn build
    44
    45  - name: Deploy to Frontend Server DEV
    46    if: ${{ contains(github.ref, 'dev') }}
    47    uses: easingthemes/ssh-deploy@v2.1.5
    48    env:
    49      SSH_PRIVATE_KEY: ${{ secrets.DEV_KEY }}
    50      ARGS: '-rltgoDzvO --delete'
    51      SOURCE: 'deploy/'
    52      REMOTE_HOST: ${{ secrets.DEV_HOST }}
    53      REMOTE_USER: plyfolio-dev
    54      TARGET: '/home/plyfolio-dev/${{ steps.vars.outputs.environment }}/fe/deploy'
    55   {
    56  &quot;name&quot;: &quot;stackstream-fe&quot;,
    57  &quot;version&quot;: &quot;1.0.0&quot;,
    58  &quot;authors&quot;: [
    59    &quot;fayyaznofal@gmail.com&quot;
    60  ],
    61  &quot;private&quot;: true,
    62  &quot;dependencies&quot;: {
    63    &quot;@fortawesome/fontawesome-svg-core&quot;: &quot;^1.2.34&quot;,
    64    &quot;@fortawesome/free-solid-svg-icons&quot;: &quot;^5.15.2&quot;,
    65    &quot;@fortawesome/react-fontawesome&quot;: &quot;^0.1.14&quot;,
    66    &quot;@fullcalendar/bootstrap&quot;: &quot;^5.5.0&quot;,
    67    &quot;@fullcalendar/core&quot;: &quot;^5.5.0&quot;,
    68    &quot;@fullcalendar/daygrid&quot;: &quot;^5.5.0&quot;,
    69    &quot;@fullcalendar/interaction&quot;: &quot;^5.5.0&quot;,
    70    &quot;@fullcalendar/react&quot;: &quot;^5.5.0&quot;,
    71    &quot;@lourenci/react-kanban&quot;: &quot;^2.1.0&quot;,
    72    &quot;@redux-saga/simple-saga-monitor&quot;: &quot;^1.1.2&quot;,
    73    &quot;@testing-library/jest-dom&quot;: &quot;^5.11.9&quot;,
    74    &quot;@testing-library/react&quot;: &quot;^11.2.3&quot;,
    75    &quot;@testing-library/user-event&quot;: &quot;^12.6.0&quot;,
    76    &quot;@toast-ui/react-chart&quot;: &quot;^1.0.2&quot;,
    77    &quot;@types/jest&quot;: &quot;^26.0.14&quot;,
    78    &quot;@types/node&quot;: &quot;^14.10.3&quot;,
    79    &quot;@types/react&quot;: &quot;^16.9.49&quot;,
    80    &quot;@types/react-dom&quot;: &quot;^16.9.8&quot;,
    81    &quot;@vtaits/react-color-picker&quot;: &quot;^0.1.1&quot;,
    82    &quot;apexcharts&quot;: &quot;^3.23.1&quot;,
    83    &quot;availity-reactstrap-validation&quot;: &quot;^2.7.0&quot;,
    84    &quot;axios&quot;: &quot;^0.21.1&quot;,
    85    &quot;axios-mock-adapter&quot;: &quot;^1.19.0&quot;,
    86    &quot;axios-progress-bar&quot;: &quot;^1.2.0&quot;,
    87    &quot;bootstrap&quot;: &quot;^5.0.0-beta2&quot;,
    88    &quot;chart.js&quot;: &quot;^2.9.4&quot;,
    89    &quot;chartist&quot;: &quot;^0.11.4&quot;,
    90    &quot;classnames&quot;: &quot;^2.2.6&quot;,
    91    &quot;components&quot;: &quot;^0.1.0&quot;,
    92    &quot;dotenv&quot;: &quot;^8.2.0&quot;,
    93    &quot;draft-js&quot;: &quot;^0.11.7&quot;,
    94    &quot;echarts&quot;: &quot;^4.9.0&quot;,
    95    &quot;echarts-for-react&quot;: &quot;^2.0.16&quot;,
    96    &quot;firebase&quot;: &quot;^8.2.3&quot;,
    97    &quot;google-maps-react&quot;: &quot;^2.0.6&quot;,
    98    &quot;history&quot;: &quot;^4.10.1&quot;,
    99    &quot;i&quot;: &quot;^0.3.6&quot;,
    100    &quot;i18next&quot;: &quot;^19.8.4&quot;,
    101    &quot;i18next-browser-languagedetector&quot;: &quot;^6.0.1&quot;,
    102    &quot;jsonwebtoken&quot;: &quot;^8.5.1&quot;,
    103    &quot;leaflet&quot;: &quot;^1.7.1&quot;,
    104    &quot;lodash&quot;: &quot;^4.17.21&quot;,
    105    &quot;lodash.clonedeep&quot;: &quot;^4.5.0&quot;,
    106    &quot;lodash.get&quot;: &quot;^4.4.2&quot;,
    107    &quot;metismenujs&quot;: &quot;^1.2.1&quot;,
    108    &quot;mkdirp&quot;: &quot;^1.0.4&quot;,
    109    &quot;moment&quot;: &quot;2.29.1&quot;,
    110    &quot;moment-timezone&quot;: &quot;^0.5.32&quot;,
    111    &quot;nouislider-react&quot;: &quot;^3.3.9&quot;,
    112    &quot;npm&quot;: &quot;^7.6.3&quot;,
    113    &quot;prop-types&quot;: &quot;^15.7.2&quot;,
    114    &quot;query-string&quot;: &quot;^6.14.0&quot;,
    115    &quot;react&quot;: &quot;^16.13.1&quot;,
    116    &quot;react-apexcharts&quot;: &quot;^1.3.7&quot;,
    117    &quot;react-auth-code-input&quot;: &quot;^1.0.0&quot;,
    118    &quot;react-avatar&quot;: &quot;^3.10.0&quot;,
    119    &quot;react-bootstrap&quot;: &quot;^1.5.0&quot;,
    120    &quot;react-bootstrap-editable&quot;: &quot;^0.8.2&quot;,
    121    &quot;react-bootstrap-sweetalert&quot;: &quot;^5.2.0&quot;,
    122    &quot;react-bootstrap-table-next&quot;: &quot;^4.0.3&quot;,
    123    &quot;react-bootstrap-table2-editor&quot;: &quot;^1.4.0&quot;,
    124    &quot;react-bootstrap-table2-paginator&quot;: &quot;^2.1.2&quot;,
    125    &quot;react-bootstrap-table2-toolkit&quot;: &quot;^2.1.3&quot;,
    126    &quot;react-chartist&quot;: &quot;^0.14.3&quot;,
    127    &quot;react-chartjs-2&quot;: &quot;^2.11.1&quot;,
    128    &quot;react-color&quot;: &quot;^2.19.3&quot;,
    129    &quot;react-confirm-alert&quot;: &quot;^2.7.0&quot;,
    130    &quot;react-content-loader&quot;: &quot;^6.0.1&quot;,
    131    &quot;react-countdown&quot;: &quot;^2.3.1&quot;,
    132    &quot;react-countup&quot;: &quot;^4.3.3&quot;,
    133    &quot;react-cropper&quot;: &quot;^2.1.4&quot;,
    134    &quot;react-data-table-component&quot;: &quot;^6.11.8&quot;,
    135    &quot;react-date-picker&quot;: &quot;^8.0.6&quot;,
    136    &quot;react-datepicker&quot;: &quot;^3.4.1&quot;,
    137    &quot;react-dom&quot;: &quot;^16.13.1&quot;,
    138    &quot;react-draft-wysiwyg&quot;: &quot;^1.14.5&quot;,
    139    &quot;react-drag-listview&quot;: &quot;^0.1.8&quot;,
    140    &quot;react-drawer&quot;: &quot;^1.3.4&quot;,
    141    &quot;react-dropzone&quot;: &quot;^11.2.4&quot;,
    142    &quot;react-dual-listbox&quot;: &quot;^2.0.0&quot;,
    143    &quot;react-facebook-login&quot;: &quot;^4.1.1&quot;,
    144    &quot;react-flatpickr&quot;: &quot;^3.10.6&quot;,
    145    &quot;react-google-login&quot;: &quot;^5.2.2&quot;,
    146    &quot;react-hook-form&quot;: &quot;^7.15.2&quot;,
    147    &quot;react-i18next&quot;: &quot;^11.8.5&quot;,
    148    &quot;react-icons&quot;: &quot;^4.2.0&quot;,
    149    &quot;react-image-lightbox&quot;: &quot;^5.1.1&quot;,
    150    &quot;react-input-mask&quot;: &quot;^2.0.4&quot;,
    151    &quot;react-jvectormap&quot;: &quot;^0.0.16&quot;,
    152    &quot;react-leaflet&quot;: &quot;^3.0.5&quot;,
    153    &quot;react-meta-tags&quot;: &quot;^1.0.1&quot;,
    154    &quot;react-modal-video&quot;: &quot;^1.2.6&quot;,
    155    &quot;react-notifications&quot;: &quot;^1.7.2&quot;,
    156    &quot;react-number-format&quot;: &quot;^4.7.3&quot;,
    157    &quot;react-perfect-scrollbar&quot;: &quot;^1.5.8&quot;,
    158    &quot;react-rangeslider&quot;: &quot;^2.2.0&quot;,
    159    &quot;react-rating&quot;: &quot;^2.0.5&quot;,
    160    &quot;react-rating-tooltip&quot;: &quot;^1.1.6&quot;,
    161    &quot;react-redux&quot;: &quot;^7.2.1&quot;,
    162    &quot;react-responsive-carousel&quot;: &quot;^3.2.11&quot;,
    163    &quot;react-router-dom&quot;: &quot;^5.2.0&quot;,
    164    &quot;react-script&quot;: &quot;^2.0.5&quot;,
    165    &quot;react-scripts&quot;: &quot;3.4.3&quot;,
    166    &quot;react-select&quot;: &quot;^4.3.1&quot;,
    167    &quot;react-sparklines&quot;: &quot;^1.7.0&quot;,
    168    &quot;react-star-ratings&quot;: &quot;^2.3.0&quot;,
    169    &quot;react-super-responsive-table&quot;: &quot;^5.2.0&quot;,
    170    &quot;react-switch&quot;: &quot;^6.0.0&quot;,
    171    &quot;react-table&quot;: &quot;^7.6.3&quot;,
    172    &quot;react-toastify&quot;: &quot;^7.0.3&quot;,
    173    &quot;react-toastr&quot;: &quot;^3.0.0&quot;,
    174    &quot;react-twitter-auth&quot;: &quot;0.0.13&quot;,
    175    &quot;reactstrap&quot;: &quot;^8.8.1&quot;,
    176    &quot;recharts&quot;: &quot;^2.0.8&quot;,
    177    &quot;redux&quot;: &quot;^4.0.5&quot;,
    178    &quot;redux-saga&quot;: &quot;^1.1.3&quot;,
    179    &quot;reselect&quot;: &quot;^4.0.0&quot;,
    180    &quot;sass&quot;: &quot;^1.37.5&quot;,
    181    &quot;simplebar-react&quot;: &quot;^2.3.0&quot;,
    182    &quot;styled&quot;: &quot;^1.0.0&quot;,
    183    &quot;styled-components&quot;: &quot;^5.2.1&quot;,
    184    &quot;toastr&quot;: &quot;^2.1.4&quot;,
    185    &quot;typescript&quot;: &quot;^4.0.2&quot;,
    186    &quot;universal-cookie&quot;: &quot;^4.0.4&quot;
    187  },
    188  &quot;devDependencies&quot;: {
    189    &quot;@typescript-eslint/eslint-plugin&quot;: &quot;^2.27.0&quot;,
    190    &quot;@typescript-eslint/parser&quot;: &quot;^2.27.0&quot;,
    191    &quot;@typescript-eslint/typescript-estree&quot;: &quot;^4.15.2&quot;,
    192    &quot;eslint-config-prettier&quot;: &quot;^6.10.1&quot;,
    193    &quot;eslint-plugin-prettier&quot;: &quot;^3.1.2&quot;,
    194    &quot;husky&quot;: &quot;^4.2.5&quot;,
    195    &quot;lint-staged&quot;: &quot;^10.1.3&quot;,
    196    &quot;prettier&quot;: &quot;^1.19.1&quot;,
    197    &quot;react-test-renderer&quot;: &quot;^16.13.1&quot;,
    198    &quot;redux-devtools-extension&quot;: &quot;^2.13.8&quot;,
    199    &quot;redux-mock-store&quot;: &quot;^1.5.4&quot;
    200  },
    201  &quot;scripts&quot;: {
    202    &quot;start&quot;: &quot;react-scripts start&quot;,
    203    &quot;build&quot;: &quot;react-scripts build &amp;&amp; mv build ./deploy/build&quot;,
    204    &quot;build-local&quot;: &quot;react-scripts build&quot;,
    205    &quot;test&quot;: &quot;react-scripts test&quot;,
    206    &quot;eject&quot;: &quot;react-scripts eject&quot;
    207  },
    208  &quot;eslintConfig&quot;: {
    209    &quot;extends&quot;: &quot;react-app&quot;
    210  },
    211  &quot;husky&quot;: {
    212    &quot;hooks&quot;: {
    213      &quot;pre-commit&quot;: &quot;lint-staged&quot;
    214    }
    215  },
    216  &quot;lint-staged&quot;: {
    217    &quot;*.{js,ts,tsx}&quot;: [
    218      &quot;eslint --fix&quot;
    219    ]
    220  },
    221  &quot;browserslist&quot;: {
    222    &quot;production&quot;: [
    223      &quot;&gt;0.2%&quot;,
    224      &quot;not dead&quot;,
    225      &quot;not op_mini all&quot;
    226    ],
    227    &quot;development&quot;: [
    228      &quot;last 1 chrome version&quot;,
    229      &quot;last 1 firefox version&quot;,
    230      &quot;last 1 safari version&quot;
    231    ]
    232  }
    233}
    234    - name: Fix up git URLs
    235      run: echo -e '[url &quot;https://github.com/&quot;]\n  insteadOf = &quot;git://github.com/&quot;' &gt;&gt; ~/.gitconfig
    236git config --global url.&quot;https://github.com/&quot;.insteadOf git://github.com/
    237git config --global url.&quot;git@github.com:&quot;.insteadOf git://github.com/
    238

    That will change any git://github.com/ (unencrypted Git protocol) into git@github.com: (SSH URL).

    Source https://stackoverflow.com/questions/70663523

    QUESTION

    What is the alternative for Redirect in react-router-dom v 6.0.0?

    Asked 2022-Mar-25 at 17:49

    New version of react-router-dom (v6.0.0) doesn't identify "Redirect". What is the alternative for it?

    ANSWER

    Answered 2021-Nov-14 at 09:17

    Here is what the react-router-dom teams said on the matter of redirects when that removed that API in v6: https://github.com/remix-run/react-router/blob/main/docs/upgrading/reach.md#redirect-redirectto-isredirect

    Source https://stackoverflow.com/questions/69961684

    QUESTION

    How to redirect in React Router v6?

    Asked 2022-Mar-24 at 17:22

    I am trying to upgrade to React Router v6 (react-router-dom 6.0.1).

    Here is my updated code:

    1import { BrowserRouter, Navigate, Route, Routes } from 'react-router-dom';
    2
    3&lt;BrowserRouter&gt;
    4  &lt;Routes&gt;
    5    &lt;Route path=&quot;/&quot; element={&lt;Home /&gt;} /&gt;
    6    &lt;Route path=&quot;/lab&quot; element={&lt;Lab /&gt;} /&gt;
    7    &lt;Route render={() =&gt; &lt;Navigate to=&quot;/&quot; /&gt;} /&gt;
    8  &lt;/Routes&gt;
    9&lt;/BrowserRouter&gt;
    10

    The last Route is redirecting the rest of paths to /.

    However, I got an error

    TS2322: Type '{ render: () => Element; }' is not assignable to type 'IntrinsicAttributes & (PathRouteProps | LayoutRouteProps | IndexRouteProps)'.   Property 'render' does not exist on type 'IntrinsicAttributes & (PathRouteProps | LayoutRouteProps | IndexRouteProps)'.

    However, based on the doc, it does have render for Route. How to use it correctly?

    ANSWER

    Answered 2022-Mar-18 at 18:41

    I think you should use the no match route approach.

    Check this in the documentation.

    https://reactrouter.com/docs/en/v6/getting-started/tutorial#adding-a-no-match-route

    1import { BrowserRouter, Navigate, Route, Routes } from 'react-router-dom';
    2
    3&lt;BrowserRouter&gt;
    4  &lt;Routes&gt;
    5    &lt;Route path=&quot;/&quot; element={&lt;Home /&gt;} /&gt;
    6    &lt;Route path=&quot;/lab&quot; element={&lt;Lab /&gt;} /&gt;
    7    &lt;Route render={() =&gt; &lt;Navigate to=&quot;/&quot; /&gt;} /&gt;
    8  &lt;/Routes&gt;
    9&lt;/BrowserRouter&gt;
    10import { BrowserRouter, Navigate, Route, Routes } from 'react-router-dom';
    11
    12&lt;BrowserRouter&gt;
    13  &lt;Routes&gt;
    14    &lt;Route path=&quot;/&quot; element={&lt;Home /&gt;} /&gt;
    15    &lt;Route path=&quot;/lab&quot; element={&lt;Lab /&gt;} /&gt;
    16    &lt;Route
    17        path=&quot;*&quot;
    18        element={&lt;Navigate to=&quot;/&quot; replace /&gt;}
    19    /&gt;
    20  &lt;/Routes&gt;
    21&lt;/BrowserRouter&gt;
    22
    Update - 18/03/2022

    To keep the history clean, you should set replace prop. This will avoid extra redirects after the user click back. Thanks @Paul for this tip.

    Source https://stackoverflow.com/questions/69868956

    QUESTION

    Error: [PrivateRoute] is not a &lt;Route&gt; component. All component children of &lt;Routes&gt; must be a &lt;Route&gt; or &lt;React.Fragment&gt;

    Asked 2022-Mar-24 at 16:08

    I'm using React Router v6 and am creating private routes for my application.

    In file PrivateRoute.js, I've the code

    1import React from 'react';
    2import {Route,Navigate} from &quot;react-router-dom&quot;;
    3import {isauth}  from 'auth'
    4
    5function PrivateRoute({ element, path }) {
    6  const authed = isauth() // isauth() returns true or false based on localStorage
    7  const ele = authed === true ? element : &lt;Navigate to=&quot;/Home&quot;  /&gt;;
    8  return &lt;Route path={path} element={ele} /&gt;;
    9}
    10
    11export default PrivateRoute
    12

    And in file route.js I've written as:

    1import React from 'react';
    2import {Route,Navigate} from &quot;react-router-dom&quot;;
    3import {isauth}  from 'auth'
    4
    5function PrivateRoute({ element, path }) {
    6  const authed = isauth() // isauth() returns true or false based on localStorage
    7  const ele = authed === true ? element : &lt;Navigate to=&quot;/Home&quot;  /&gt;;
    8  return &lt;Route path={path} element={ele} /&gt;;
    9}
    10
    11export default PrivateRoute
    12 ...
    13&lt;PrivateRoute exact path=&quot;/&quot; element={&lt;Dashboard/&gt;}/&gt;
    14&lt;Route exact path=&quot;/home&quot; element={&lt;Home/&gt;}/&gt;
    15

    I've gone through the same example React-router Auth Example - StackBlitz, file App.tsx

    Is there something I'm missing?

    ANSWER

    Answered 2021-Nov-12 at 21:20

    I ran into the same issue today and came up with the following solution based on this very helpful article by Andrew Luca

    In PrivateRoute.js:

    1import React from 'react';
    2import {Route,Navigate} from &quot;react-router-dom&quot;;
    3import {isauth}  from 'auth'
    4
    5function PrivateRoute({ element, path }) {
    6  const authed = isauth() // isauth() returns true or false based on localStorage
    7  const ele = authed === true ? element : &lt;Navigate to=&quot;/Home&quot;  /&gt;;
    8  return &lt;Route path={path} element={ele} /&gt;;
    9}
    10
    11export default PrivateRoute
    12 ...
    13&lt;PrivateRoute exact path=&quot;/&quot; element={&lt;Dashboard/&gt;}/&gt;
    14&lt;Route exact path=&quot;/home&quot; element={&lt;Home/&gt;}/&gt;
    15import React from 'react';
    16import { Navigate, Outlet } from 'react-router-dom';
    17
    18const PrivateRoute = () =&gt; {
    19    const auth = null; // determine if authorized, from context or however you're doing it
    20
    21    // If authorized, return an outlet that will render child elements
    22    // If not, return element that will navigate to login page
    23    return auth ? &lt;Outlet /&gt; : &lt;Navigate to=&quot;/login&quot; /&gt;;
    24}
    25

    In App.js (I've left in some other pages as examples):

    1import React from 'react';
    2import {Route,Navigate} from &quot;react-router-dom&quot;;
    3import {isauth}  from 'auth'
    4
    5function PrivateRoute({ element, path }) {
    6  const authed = isauth() // isauth() returns true or false based on localStorage
    7  const ele = authed === true ? element : &lt;Navigate to=&quot;/Home&quot;  /&gt;;
    8  return &lt;Route path={path} element={ele} /&gt;;
    9}
    10
    11export default PrivateRoute
    12 ...
    13&lt;PrivateRoute exact path=&quot;/&quot; element={&lt;Dashboard/&gt;}/&gt;
    14&lt;Route exact path=&quot;/home&quot; element={&lt;Home/&gt;}/&gt;
    15import React from 'react';
    16import { Navigate, Outlet } from 'react-router-dom';
    17
    18const PrivateRoute = () =&gt; {
    19    const auth = null; // determine if authorized, from context or however you're doing it
    20
    21    // If authorized, return an outlet that will render child elements
    22    // If not, return element that will navigate to login page
    23    return auth ? &lt;Outlet /&gt; : &lt;Navigate to=&quot;/login&quot; /&gt;;
    24}
    25import './App.css';
    26import React, {Fragment} from 'react';
    27import {BrowserRouter as Router, Route, Routes} from 'react-router-dom';
    28import Navbar from './components/layout/Navbar';
    29import Home from './components/pages/Home';
    30import Register from './components/auth/Register'
    31import Login from './components/auth/Login';
    32import PrivateRoute from './components/routing/PrivateRoute';
    33
    34const App = () =&gt; {
    35  return (
    36    &lt;Router&gt;
    37      &lt;Fragment&gt;
    38        &lt;Navbar/&gt;
    39        &lt;Routes&gt;
    40          &lt;Route exact path='/' element={&lt;PrivateRoute/&gt;}&gt;
    41            &lt;Route exact path='/' element={&lt;Home/&gt;}/&gt;
    42          &lt;/Route&gt;
    43          &lt;Route exact path='/register' element={&lt;Register/&gt;}/&gt;
    44          &lt;Route exact path='/login' element={&lt;Login/&gt;}/&gt;
    45        &lt;/Routes&gt;
    46      &lt;/Fragment&gt;
    47    &lt;/Router&gt;
    48    
    49  );
    50}
    51

    In the above routing, this is the private route:

    1import React from 'react';
    2import {Route,Navigate} from &quot;react-router-dom&quot;;
    3import {isauth}  from 'auth'
    4
    5function PrivateRoute({ element, path }) {
    6  const authed = isauth() // isauth() returns true or false based on localStorage
    7  const ele = authed === true ? element : &lt;Navigate to=&quot;/Home&quot;  /&gt;;
    8  return &lt;Route path={path} element={ele} /&gt;;
    9}
    10
    11export default PrivateRoute
    12 ...
    13&lt;PrivateRoute exact path=&quot;/&quot; element={&lt;Dashboard/&gt;}/&gt;
    14&lt;Route exact path=&quot;/home&quot; element={&lt;Home/&gt;}/&gt;
    15import React from 'react';
    16import { Navigate, Outlet } from 'react-router-dom';
    17
    18const PrivateRoute = () =&gt; {
    19    const auth = null; // determine if authorized, from context or however you're doing it
    20
    21    // If authorized, return an outlet that will render child elements
    22    // If not, return element that will navigate to login page
    23    return auth ? &lt;Outlet /&gt; : &lt;Navigate to=&quot;/login&quot; /&gt;;
    24}
    25import './App.css';
    26import React, {Fragment} from 'react';
    27import {BrowserRouter as Router, Route, Routes} from 'react-router-dom';
    28import Navbar from './components/layout/Navbar';
    29import Home from './components/pages/Home';
    30import Register from './components/auth/Register'
    31import Login from './components/auth/Login';
    32import PrivateRoute from './components/routing/PrivateRoute';
    33
    34const App = () =&gt; {
    35  return (
    36    &lt;Router&gt;
    37      &lt;Fragment&gt;
    38        &lt;Navbar/&gt;
    39        &lt;Routes&gt;
    40          &lt;Route exact path='/' element={&lt;PrivateRoute/&gt;}&gt;
    41            &lt;Route exact path='/' element={&lt;Home/&gt;}/&gt;
    42          &lt;/Route&gt;
    43          &lt;Route exact path='/register' element={&lt;Register/&gt;}/&gt;
    44          &lt;Route exact path='/login' element={&lt;Login/&gt;}/&gt;
    45        &lt;/Routes&gt;
    46      &lt;/Fragment&gt;
    47    &lt;/Router&gt;
    48    
    49  );
    50}
    51&lt;Route exact path='/' element={&lt;PrivateRoute/&gt;}&gt;
    52      &lt;Route exact path='/' element={&lt;Home/&gt;}/&gt;
    53&lt;/Route&gt;
    54

    If authorization is successful, the element will show. Otherwise, it will navigate to the login page.

    Source https://stackoverflow.com/questions/69864165

    Community Discussions contain sources that include Stack Exchange Network

    Tutorials and Learning Resources in Router

    Tutorials and Learning Resources are not available at this moment for Router

    Share this Page

    share link

    Get latest updates on Router