Create-React-App Error.
See original GitHub issueI get this error when trying to use react-router-transition
with a create-react-app
project.
./node_modules/react-router-transition/src/AnimatedRoute.js
Module parse failed: /node_modules/react-router-transition/src/AnimatedRoute.js Unexpected token (16:49)
You may need an appropriate loader to handle this file type.
| }
|
| const AnimatedRoute = ({ component, path, exact, ...routeTransitionProps }) => (
| <Route
| render={({ location, match }) => (
i’m not quite sure what the problem is. At first i was thinking it was because of the spread operator but CRA seems to have it enabled.
Anyone got this before ?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:8
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Create React App not working - Stack Overflow
1. update the npm version (npm install npm@latest -g) · 2. clear the cache (npm cache clean --force) · 3. create the react...
Read more >npx create-react-app not working? Here's the solution.
The current solution is simple — run create-react-app and target the latest version. Run creact-react-app using the latest version. npx create- ...
Read more >npx create-react-app is not working · Issue #10132 - GitHub
I am able to solve the problem by first trying to uninstall the npm globally, update the npm, clear the cache then using...
Read more >What To Do if create-react-app Doesn't Work
1. npm uninstall -g create-react-app. This is the npm command to uninstall your global installation of create-react-app .
Read more >Create a New React App
The toolchains recommended on this page don't require configuration to get started. You Might Not Need a Toolchain. If you don't experience the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Heres how i did it. You can import it with a relative path
import { AnimatedSwitch } from 'react-router-transition/lib/react-router-transition'
Rest spread is enabled, but it’s likely that node_modules are excluded from your webpack configuration’s babelification.
That’s a bug on our part; we should probably point the module file at a transpiled copy which retains the ES6 module declaration.
In the mean time you can work around this by aliasing
react-router-transitions
tolib/react-router-transition.js
Config link here: https://webpack.js.org/configuration/resolve/#resolve-alias