title: Its instance type 'BrowserRouter' is not a valid JSX element
body: <p>I work on a project developed in React + coreui that has always worked perfectly. However, in the last week, I had an inexplicable problem when deploying a modification.</p>
  <pre><code>18:03:11  Creating an optimized production build...
  18:04:32  Failed to compile.
  18:04:32  
  18:04:32  /var/lib/jenkins/workspace/deploy-sandbox/src/AppRouter.tsx
  18:04:32  Type error in /var/lib/jenkins/workspace/deploy-sandbox/src/AppRouter.tsx(47,6):
  18:04:32  'Router' cannot be used as a JSX component.
  18:04:32    Its instance type 'BrowserRouter' is not a valid JSX element.
  18:04:32      The types returned by 'render()' are incompatible between these types.
  18:04:32        Type 'React.ReactNode' is not assignable to type 'import(&quot;/var/lib/jenkins/workspace/deploy-sandbox/node_modules/@types/react-transition-group/node_modules/@types/react/index&quot;).ReactNode'.  TS2786
  18:04:32  
  18:04:32      45 | 
  18:04:32      46 |   return (
  18:04:32    &gt; 47 |     &lt;Router&gt;
  18:04:32         |      ^
  </code></pre>
  <p>I haven't modified anything in the project's structure or dependencies that could generate this error.</p>
  <p>I believe there is some dependency conflict because from that moment on, it happens constantly.</p>
  <p>I've tried many alternatives to try to solve the problem, but so far, without success. Has anyone experienced this and know of a solution? Or Do you know where to find the problem?</p>
  <pre><code>
    &quot;dependencies&quot;: {
      &quot;@coreui/chartjs&quot;: &quot;^3.0.0&quot;,
      &quot;@coreui/coreui-pro&quot;: &quot;^3.4.2&quot;,
      &quot;@coreui/coreui&quot;: &quot;^4.1.3&quot;,
      &quot;@coreui/icons-pro&quot;: &quot;^2.0.3&quot;,
      &quot;@coreui/icons-react&quot;: &quot;^1.1.0&quot;,
      &quot;@coreui/icons&quot;: &quot;^2.1.0&quot;,
      &quot;@coreui/react-chartjs&quot;: &quot;^1.1.0&quot;,
      &quot;@coreui/react&quot;: &quot;^3.4.6&quot;,
      &quot;@coreui/utils&quot;: &quot;^1.3.1&quot;,
      &quot;del&quot;: &quot;^6.0.0&quot;,
      &quot;gulp-zip&quot;: &quot;^5.1.0&quot;,
      &quot;gulp&quot;: &quot;^4.0.2&quot;,
      &quot;http-status&quot;: &quot;^1.5.0&quot;,
      &quot;moment&quot;: &quot;^2.29.2&quot;,
      &quot;react-dom&quot;: &quot;^17.0.2&quot;,
      &quot;react-hook-form&quot;: &quot;^7.29.0&quot;,
      &quot;react-imask&quot;: &quot;^6.4.2&quot;,
      &quot;react-papaparse&quot;: &quot;^3.18.2&quot;,
      &quot;react-password-strength-bar&quot;: &quot;^0.4.0&quot;,
      &quot;react-query&quot;: &quot;^3.34.19&quot;,
      &quot;react-router-dom&quot;: &quot;^5.3.0&quot;,
      &quot;react-router&quot;: &quot;^5.2.1&quot;,
      &quot;react-scripts&quot;: &quot;^5.0.0&quot;,
      &quot;react-select&quot;: &quot;^5.2.2&quot;,
      &quot;react&quot;: &quot;^17.0.2&quot;,
      &quot;spinkit&quot;: &quot;^2.0.1&quot;,
      &quot;use-debounce&quot;: &quot;^7.0.1&quot;,
      &quot;web-vitals&quot;: &quot;^2.1.4&quot;
    },
    &quot;eslintConfig&quot;: {
      &quot;extends&quot;: [
        &quot;react-app&quot;,
        &quot;react-app/jest&quot;
      ]
    },
    &quot;browserslist&quot;: {
      &quot;production&quot;: [
        &quot;&gt;0.2%&quot;,
        &quot;not dead&quot;,
        &quot;not op_mini all&quot;
      ],
      &quot;development&quot;: [
        &quot;last 1 chrome version&quot;,
        &quot;last 1 firefox version&quot;,
        &quot;last 1 safari version&quot;
      ],
      &quot;sass&quot;: &quot;^1.32.8&quot;
    },
    &quot;eslint-config-prettier&quot;: &quot;=8.3.0&quot;,
    &quot;devDependencies&quot;: {
      &quot;@testing-library/jest-dom&quot;: &quot;^5.16.1&quot;,
      &quot;@testing-library/react&quot;: &quot;^12.1.2&quot;,
      &quot;@testing-library/user-event&quot;: &quot;^13.5.0&quot;,
      &quot;@types/jest&quot;: &quot;^27.4.0&quot;,
      &quot;@types/node&quot;: &quot;^17.0.7&quot;,
      &quot;@types/react&quot;: &quot;^17.0.38&quot;,
      &quot;@types/react-dom&quot;: &quot;^17.0.11&quot;,
      &quot;@types/react-router-dom&quot;: &quot;^5.3.2&quot;,
      &quot;@types/react-select&quot;: &quot;^5.0.1&quot;,
      &quot;@typescript-eslint/eslint-plugin&quot;: &quot;^5.8.1&quot;,
      &quot;eslint-config-airbnb&quot;: &quot;^18.2.1&quot;,
      &quot;eslint-import-resolver-alias&quot;: &quot;^1.1.2&quot;,
      &quot;eslint-plugin-import&quot;: &quot;^2.25.4&quot;,
      &quot;eslint-plugin-react&quot;: &quot;=7.28.0&quot;,
      &quot;http-proxy-middleware&quot;: &quot;^2.0.1&quot;,
      &quot;sass&quot;: &quot;^1.45.2&quot;,
      &quot;typescript&quot;: &quot;^4.5.4&quot;
    }
  </code></pre>