Tag Archives: DVA switches history to browserhistory Error

How to Solve DVA switches history to browserhistory Error

report errors:

Module not found: Can't resolve 'history/createBrowserHistory'

Solution:

// import createHistory from 'history/createBrowserHistory';
// Error: Cannot find module 'history/createBrowserHistory';

// Change to
import { createBrowserHistory  as createHistory} from 'history';

const app = dva({
  history: createHistory(),
});