question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Create-React-App Error.

See original GitHub issue

I 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:closed
  • Created 6 years ago
  • Reactions:8
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
etiennelacoursierecommented, Sep 13, 2017

Heres how i did it. You can import it with a relative path import { AnimatedSwitch } from 'react-router-transition/lib/react-router-transition'

5reactions
jacobangelcommented, Sep 12, 2017

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 to lib/react-router-transition.js

Config link here: https://webpack.js.org/configuration/resolve/#resolve-alias

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found