remix-run / react-router

Declarative routing for React
https://reactrouter.com
MIT License
53.08k stars 10.31k forks source link

React-router4.0 won't run in Android 4.x WebView #4886

Closed vvkee closed 7 years ago

vvkee commented 7 years ago

android 4.4 chrome 30.0.0 package.json

"dependencies": {
    "babel-polyfill": "^6.23.0",
    "date-fns": "^1.28.2",
    "immutability-helper": "^2.0.0",
    "immutable": "^3.8.1",
    "lodash": "^4.17.4",
    "moment": "^2.17.1",
    "moment-range": "^3.0.3",
    "querystring": "^0.2.0",
    "react": "^15.4.2",
    "react-addons-css-transition-group": "^15.4.1",
    "react-addons-perf": "^15.3.1",
    "react-addons-pure-render-mixin": "^15.4.1",
    "react-dom": "^15.4.2",
    "react-motion": "0.4.7",
    "react-motion-ui-pack": "^0.10.2",
    "react-redux": "^4.4.6",
    "react-router-dom": "^4.0.0",
    "react-router-redux": "next",
    "react-tappable": "^0.8.4",
    "react-virtualized": "^9.4.0",
    "redux": "^3.5.2",
    "redux-actions": "^0.11.0",
    "redux-immutablejs": "0.0.8",
    "redux-logger": "^2.7.0",
    "redux-thunk": "^2.1.0",
    "whatwg-fetch": "^1.0.0"
  }

App runs well in modern browsers on PC/Mac, iOS UIWebview, mobile Safari, Android (also 4.x) Chrome, and Android >5.x.

I got this error. image

Routes

import React from 'react'
import { Provider } from 'react-redux'
import { ConnectedRouter } from 'react-router-redux'
import { Route, Redirect } from 'react-router-dom'

import _store from '../store'
import OrderTransferRouter from './OrderTransferRouter'
import LoginRouter from './LoginRouter'

const { store, history } = _store
const Routes = () => (
    <Provider store={store}>
        <ConnectedRouter history={history}>
            <div>
                <Route exact path="/" render={() => (
                    <Redirect to="/m/orderTransfer"/>
                )}/>
                <OrderTransferRouter />
                <LoginRouter />
            </div>
        </ConnectedRouter>
    </Provider>
)
export { Routes, store }
pshrmn commented 7 years ago

That error doesn't imply that the issue is caused by React Router.

The object described in the error is a React element, so it doesn't make sense to me why React is having trouble with it. I would open the debugger and figure out the type of the object that is causing this error. That should be doable by setting a breakpoint here https://github.com/facebook/react/blob/34e4352cba3bbba0a5afd5b826cc0f91e33318bc/src/shared/utils/traverseAllChildren.js#L167