Ask questionsReceiving ESM Error but not using ESM
<!-- BUG TEMPLATE -->
5.0.0
import {HashRouter, Switch, Route} from 'react-router-dom';In my console I see this error
Please use `import { Router } from "react-router"` instead of `import Router from "react-router/es/undefined"`. Support for the latter will be removed in the next major release
I am not importing anything with the es/undefined syntax so this error should not appear.
Answer
questions
StringEpsilon
Can you create a minimum reproduction repository? This really shouldn't happen, unless a step in your build process changes the imports or another dependency of yours uses the old import style.
At the very least, we need more information about your build process. Do you use babel with any fancy plugins? Typescript? Rollup, Parcel or Webpack? (Edit: This is most likely an issue with your setup)
Related questions