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.

Files outside src/ aren't compiled with Babel

See original GitHub issue

Problem: Using ES6 feature like template string or fat arrow function notation, in any helper JS functions to fetch data and pass it to React components, npm start works fine but npm run build fails

Error:-

static/js/main.edbb179d.js from UglifyJs
SyntaxError: Unexpected token: operator (>) [./api/consensus_view-api.js:65,0]

static/js/main.d10c594a.js from UglifyJs
SyntaxError: Unexpected character '`' [./api/consensus_view-api.js:25,0]

node - 6.10.0 npm - 3.10.10 OS - MacOS El Capitan react-scripts: 0.9.3

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
debugpoint136commented, Mar 2, 2017

Oh wow! Thanks for catching that. I moved that folder to src and it compiles successfully!

0reactions
gaearoncommented, Mar 28, 2017

Replied there.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The create-react-app imports restriction outside of src directory
I am trying to call an image from my public folder from a file inside my src/components . I am receiving this error...
Read more >
Babel CLI
Compile the entire src directory and output it to the lib directory by using either --out-dir or -d . This doesn't overwrite any...
Read more >
Documentation - Module Resolution - TypeScript
Module resolution is the process the compiler uses to figure out what an import refers to. Consider an import statement like import {...
Read more >
rollup.js
js and webpack, you can use Rollup to compile to UMD or CommonJS format, and then point to that compiled version with the...
Read more >
Configuration - Quokka.js
When using Babel to compile TypeScript files, Quokka will run your code using node instead of ts-node . An example configuration is shown...
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