I have this code:
\"use strict\";
import browserSync from \"browser-sync\";
import httpProxy from \"http-proxy\";
let proxy = httpProxy.createProxyServer({
Ultimate solution
I wasted 3 days on this
import react from 'react' unexpected identifier
I tried modifying webpack.config.js
and package.json
files, and adding .babelrc
, installing & updating packages via npm
, I've visited many, many pages but nothing has worked.
What worked? Two words: npm start. That's right.
run the
npm start
command in the terminal to launch a local server
...
(mind that it might not work straight away but perhaps only after you do some work on npm because before trying this out I had deleted all the changes in those files and it worked, so after you're really done, treat it as your last resort)
I found that info on this neat page. It's in Polish but feel free to use Google translate on it.