react redux Parsing error: Unexpected character '​'









up vote
0
down vote

favorite












Why this error appear?



enter image description here




package.json



 
"name": "react-shopping",
"version": "0.1.0",
"private": true,
"dependencies":
"@babel/core": "7.1.0",
"@svgr/webpack": "2.4.1",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "9.0.0",
"babel-jest": "23.6.0",
"babel-loader": "8.0.4",
"babel-plugin-named-asset-import": "^0.2.3",
"babel-preset-react-app": "^6.1.0",
"bfj": "6.1.1",
"case-sensitive-paths-webpack-plugin": "2.1.2",
"chalk": "2.4.1",
"css-loader": "1.0.0",
"dotenv": "6.0.0",
"dotenv-expand": "4.2.0",
"eslint": "5.6.0",
"eslint-config-react-app": "^3.0.5",
"eslint-loader": "2.1.1",
"eslint-plugin-flowtype": "2.50.1",
"eslint-plugin-import": "2.14.0",
"eslint-plugin-jsx-a11y": "6.1.2",
"eslint-plugin-react": "7.11.1",
"file-loader": "2.0.0",
"fork-ts-checker-webpack-plugin-alt": "0.4.14",
"fs-extra": "7.0.0",
"html-webpack-plugin": "4.0.0-alpha.2",
"identity-obj-proxy": "3.0.0",
"jest": "23.6.0",
"jest-pnp-resolver": "1.0.1",
"jest-resolve": "23.6.0",
"mini-css-extract-plugin": "0.4.3",
"optimize-css-assets-webpack-plugin": "5.0.1",
"pnp-webpack-plugin": "1.1.0",
"postcss-flexbugs-fixes": "4.1.0",
"postcss-loader": "3.0.0",
"postcss-preset-env": "6.0.6",
"postcss-safe-parser": "4.0.1",
"react": "^16.6.1",
"react-app-polyfill": "^0.1.3",
"react-dev-utils": "^6.1.1",
"react-dom": "^16.6.1",
"react-redux": "^5.1.1",
"redux": "^4.0.1",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.3.0",
"resolve": "1.8.1",
"sass-loader": "7.1.0",
"style-loader": "0.23.0",
"terser-webpack-plugin": "1.1.0",
"url-loader": "1.1.1",
"webpack": "4.19.1",
"webpack-dev-server": "3.1.9",
"webpack-manifest-plugin": "2.0.4",
"workbox-webpack-plugin": "3.6.3"
,
"scripts":
"start": "node scripts/start.js",
"build": "node scripts/build.js",
"test": "node scripts/test.js"
,
"eslintConfig":
"extends": "react-app"
,
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
],
"jest": jsx,
"babel":
"presets": [
"react-app"
]





store.js





import createStore from 'redux';

function todos(state = , action)
switch (action.type)
case 'ADD_TODO':
return state.concat([action.text]);
default:
return state;



const store = createStore(todos, ['Use Redux']);

store.dispatch(
type: 'ADD_TODO',
text: 'Read the docs'
);

console.log(store.getState());



App.js



import React, Component from 'react';
import './store';

class App extends Component
render()
return (
<div className="App">
<h1>asdas</h1>
</div>
);



export default App;









share|improve this question























  • Get rid of [‘Use Redux’] in your create store...
    – SakoBu
    Nov 11 at 6:12














up vote
0
down vote

favorite












Why this error appear?



enter image description here




package.json



 
"name": "react-shopping",
"version": "0.1.0",
"private": true,
"dependencies":
"@babel/core": "7.1.0",
"@svgr/webpack": "2.4.1",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "9.0.0",
"babel-jest": "23.6.0",
"babel-loader": "8.0.4",
"babel-plugin-named-asset-import": "^0.2.3",
"babel-preset-react-app": "^6.1.0",
"bfj": "6.1.1",
"case-sensitive-paths-webpack-plugin": "2.1.2",
"chalk": "2.4.1",
"css-loader": "1.0.0",
"dotenv": "6.0.0",
"dotenv-expand": "4.2.0",
"eslint": "5.6.0",
"eslint-config-react-app": "^3.0.5",
"eslint-loader": "2.1.1",
"eslint-plugin-flowtype": "2.50.1",
"eslint-plugin-import": "2.14.0",
"eslint-plugin-jsx-a11y": "6.1.2",
"eslint-plugin-react": "7.11.1",
"file-loader": "2.0.0",
"fork-ts-checker-webpack-plugin-alt": "0.4.14",
"fs-extra": "7.0.0",
"html-webpack-plugin": "4.0.0-alpha.2",
"identity-obj-proxy": "3.0.0",
"jest": "23.6.0",
"jest-pnp-resolver": "1.0.1",
"jest-resolve": "23.6.0",
"mini-css-extract-plugin": "0.4.3",
"optimize-css-assets-webpack-plugin": "5.0.1",
"pnp-webpack-plugin": "1.1.0",
"postcss-flexbugs-fixes": "4.1.0",
"postcss-loader": "3.0.0",
"postcss-preset-env": "6.0.6",
"postcss-safe-parser": "4.0.1",
"react": "^16.6.1",
"react-app-polyfill": "^0.1.3",
"react-dev-utils": "^6.1.1",
"react-dom": "^16.6.1",
"react-redux": "^5.1.1",
"redux": "^4.0.1",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.3.0",
"resolve": "1.8.1",
"sass-loader": "7.1.0",
"style-loader": "0.23.0",
"terser-webpack-plugin": "1.1.0",
"url-loader": "1.1.1",
"webpack": "4.19.1",
"webpack-dev-server": "3.1.9",
"webpack-manifest-plugin": "2.0.4",
"workbox-webpack-plugin": "3.6.3"
,
"scripts":
"start": "node scripts/start.js",
"build": "node scripts/build.js",
"test": "node scripts/test.js"
,
"eslintConfig":
"extends": "react-app"
,
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
],
"jest": jsx,
"babel":
"presets": [
"react-app"
]





store.js





import createStore from 'redux';

function todos(state = , action)
switch (action.type)
case 'ADD_TODO':
return state.concat([action.text]);
default:
return state;



const store = createStore(todos, ['Use Redux']);

store.dispatch(
type: 'ADD_TODO',
text: 'Read the docs'
);

console.log(store.getState());



App.js



import React, Component from 'react';
import './store';

class App extends Component
render()
return (
<div className="App">
<h1>asdas</h1>
</div>
);



export default App;









share|improve this question























  • Get rid of [‘Use Redux’] in your create store...
    – SakoBu
    Nov 11 at 6:12












up vote
0
down vote

favorite









up vote
0
down vote

favorite











Why this error appear?



enter image description here




package.json



 
"name": "react-shopping",
"version": "0.1.0",
"private": true,
"dependencies":
"@babel/core": "7.1.0",
"@svgr/webpack": "2.4.1",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "9.0.0",
"babel-jest": "23.6.0",
"babel-loader": "8.0.4",
"babel-plugin-named-asset-import": "^0.2.3",
"babel-preset-react-app": "^6.1.0",
"bfj": "6.1.1",
"case-sensitive-paths-webpack-plugin": "2.1.2",
"chalk": "2.4.1",
"css-loader": "1.0.0",
"dotenv": "6.0.0",
"dotenv-expand": "4.2.0",
"eslint": "5.6.0",
"eslint-config-react-app": "^3.0.5",
"eslint-loader": "2.1.1",
"eslint-plugin-flowtype": "2.50.1",
"eslint-plugin-import": "2.14.0",
"eslint-plugin-jsx-a11y": "6.1.2",
"eslint-plugin-react": "7.11.1",
"file-loader": "2.0.0",
"fork-ts-checker-webpack-plugin-alt": "0.4.14",
"fs-extra": "7.0.0",
"html-webpack-plugin": "4.0.0-alpha.2",
"identity-obj-proxy": "3.0.0",
"jest": "23.6.0",
"jest-pnp-resolver": "1.0.1",
"jest-resolve": "23.6.0",
"mini-css-extract-plugin": "0.4.3",
"optimize-css-assets-webpack-plugin": "5.0.1",
"pnp-webpack-plugin": "1.1.0",
"postcss-flexbugs-fixes": "4.1.0",
"postcss-loader": "3.0.0",
"postcss-preset-env": "6.0.6",
"postcss-safe-parser": "4.0.1",
"react": "^16.6.1",
"react-app-polyfill": "^0.1.3",
"react-dev-utils": "^6.1.1",
"react-dom": "^16.6.1",
"react-redux": "^5.1.1",
"redux": "^4.0.1",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.3.0",
"resolve": "1.8.1",
"sass-loader": "7.1.0",
"style-loader": "0.23.0",
"terser-webpack-plugin": "1.1.0",
"url-loader": "1.1.1",
"webpack": "4.19.1",
"webpack-dev-server": "3.1.9",
"webpack-manifest-plugin": "2.0.4",
"workbox-webpack-plugin": "3.6.3"
,
"scripts":
"start": "node scripts/start.js",
"build": "node scripts/build.js",
"test": "node scripts/test.js"
,
"eslintConfig":
"extends": "react-app"
,
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
],
"jest": jsx,
"babel":
"presets": [
"react-app"
]





store.js





import createStore from 'redux';

function todos(state = , action)
switch (action.type)
case 'ADD_TODO':
return state.concat([action.text]);
default:
return state;



const store = createStore(todos, ['Use Redux']);

store.dispatch(
type: 'ADD_TODO',
text: 'Read the docs'
);

console.log(store.getState());



App.js



import React, Component from 'react';
import './store';

class App extends Component
render()
return (
<div className="App">
<h1>asdas</h1>
</div>
);



export default App;









share|improve this question















Why this error appear?



enter image description here




package.json



 
"name": "react-shopping",
"version": "0.1.0",
"private": true,
"dependencies":
"@babel/core": "7.1.0",
"@svgr/webpack": "2.4.1",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "9.0.0",
"babel-jest": "23.6.0",
"babel-loader": "8.0.4",
"babel-plugin-named-asset-import": "^0.2.3",
"babel-preset-react-app": "^6.1.0",
"bfj": "6.1.1",
"case-sensitive-paths-webpack-plugin": "2.1.2",
"chalk": "2.4.1",
"css-loader": "1.0.0",
"dotenv": "6.0.0",
"dotenv-expand": "4.2.0",
"eslint": "5.6.0",
"eslint-config-react-app": "^3.0.5",
"eslint-loader": "2.1.1",
"eslint-plugin-flowtype": "2.50.1",
"eslint-plugin-import": "2.14.0",
"eslint-plugin-jsx-a11y": "6.1.2",
"eslint-plugin-react": "7.11.1",
"file-loader": "2.0.0",
"fork-ts-checker-webpack-plugin-alt": "0.4.14",
"fs-extra": "7.0.0",
"html-webpack-plugin": "4.0.0-alpha.2",
"identity-obj-proxy": "3.0.0",
"jest": "23.6.0",
"jest-pnp-resolver": "1.0.1",
"jest-resolve": "23.6.0",
"mini-css-extract-plugin": "0.4.3",
"optimize-css-assets-webpack-plugin": "5.0.1",
"pnp-webpack-plugin": "1.1.0",
"postcss-flexbugs-fixes": "4.1.0",
"postcss-loader": "3.0.0",
"postcss-preset-env": "6.0.6",
"postcss-safe-parser": "4.0.1",
"react": "^16.6.1",
"react-app-polyfill": "^0.1.3",
"react-dev-utils": "^6.1.1",
"react-dom": "^16.6.1",
"react-redux": "^5.1.1",
"redux": "^4.0.1",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.3.0",
"resolve": "1.8.1",
"sass-loader": "7.1.0",
"style-loader": "0.23.0",
"terser-webpack-plugin": "1.1.0",
"url-loader": "1.1.1",
"webpack": "4.19.1",
"webpack-dev-server": "3.1.9",
"webpack-manifest-plugin": "2.0.4",
"workbox-webpack-plugin": "3.6.3"
,
"scripts":
"start": "node scripts/start.js",
"build": "node scripts/build.js",
"test": "node scripts/test.js"
,
"eslintConfig":
"extends": "react-app"
,
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
],
"jest": jsx,
"babel":
"presets": [
"react-app"
]





store.js





import createStore from 'redux';

function todos(state = , action)
switch (action.type)
case 'ADD_TODO':
return state.concat([action.text]);
default:
return state;



const store = createStore(todos, ['Use Redux']);

store.dispatch(
type: 'ADD_TODO',
text: 'Read the docs'
);

console.log(store.getState());



App.js



import React, Component from 'react';
import './store';

class App extends Component
render()
return (
<div className="App">
<h1>asdas</h1>
</div>
);



export default App;






reactjs redux react-redux






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 11 at 4:34









Nguyễn Thanh Tú

4,5392827




4,5392827










asked Nov 11 at 4:26









Стас Рябцев

72112




72112











  • Get rid of [‘Use Redux’] in your create store...
    – SakoBu
    Nov 11 at 6:12
















  • Get rid of [‘Use Redux’] in your create store...
    – SakoBu
    Nov 11 at 6:12















Get rid of [‘Use Redux’] in your create store...
– SakoBu
Nov 11 at 6:12




Get rid of [‘Use Redux’] in your create store...
– SakoBu
Nov 11 at 6:12












1 Answer
1






active

oldest

votes

















up vote
1
down vote



accepted










Seems to me like a lint bug. When I removed two blank lines, I didn't get any errors:



import createStore from 'redux';

function todos(state = , action)
switch (action.type)
case 'ADD_TODO':
return state.concat([action.text]);
default:
return state;



const store = createStore(todos, ['Use Redux']);
store.dispatch(
type: 'ADD_TODO',
text: 'Read the docs'
);
console.log(store.getState());





share|improve this answer




















  • omg, thanks a lot !
    – Стас Рябцев
    Nov 11 at 6:24










  • oml :) (Oh my Lint)
    – Yossi
    Nov 11 at 6:27










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53245831%2freact-redux-parsing-error-unexpected-character%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
1
down vote



accepted










Seems to me like a lint bug. When I removed two blank lines, I didn't get any errors:



import createStore from 'redux';

function todos(state = , action)
switch (action.type)
case 'ADD_TODO':
return state.concat([action.text]);
default:
return state;



const store = createStore(todos, ['Use Redux']);
store.dispatch(
type: 'ADD_TODO',
text: 'Read the docs'
);
console.log(store.getState());





share|improve this answer




















  • omg, thanks a lot !
    – Стас Рябцев
    Nov 11 at 6:24










  • oml :) (Oh my Lint)
    – Yossi
    Nov 11 at 6:27














up vote
1
down vote



accepted










Seems to me like a lint bug. When I removed two blank lines, I didn't get any errors:



import createStore from 'redux';

function todos(state = , action)
switch (action.type)
case 'ADD_TODO':
return state.concat([action.text]);
default:
return state;



const store = createStore(todos, ['Use Redux']);
store.dispatch(
type: 'ADD_TODO',
text: 'Read the docs'
);
console.log(store.getState());





share|improve this answer




















  • omg, thanks a lot !
    – Стас Рябцев
    Nov 11 at 6:24










  • oml :) (Oh my Lint)
    – Yossi
    Nov 11 at 6:27












up vote
1
down vote



accepted







up vote
1
down vote



accepted






Seems to me like a lint bug. When I removed two blank lines, I didn't get any errors:



import createStore from 'redux';

function todos(state = , action)
switch (action.type)
case 'ADD_TODO':
return state.concat([action.text]);
default:
return state;



const store = createStore(todos, ['Use Redux']);
store.dispatch(
type: 'ADD_TODO',
text: 'Read the docs'
);
console.log(store.getState());





share|improve this answer












Seems to me like a lint bug. When I removed two blank lines, I didn't get any errors:



import createStore from 'redux';

function todos(state = , action)
switch (action.type)
case 'ADD_TODO':
return state.concat([action.text]);
default:
return state;



const store = createStore(todos, ['Use Redux']);
store.dispatch(
type: 'ADD_TODO',
text: 'Read the docs'
);
console.log(store.getState());






share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 11 at 6:20









Yossi

1,5092619




1,5092619











  • omg, thanks a lot !
    – Стас Рябцев
    Nov 11 at 6:24










  • oml :) (Oh my Lint)
    – Yossi
    Nov 11 at 6:27
















  • omg, thanks a lot !
    – Стас Рябцев
    Nov 11 at 6:24










  • oml :) (Oh my Lint)
    – Yossi
    Nov 11 at 6:27















omg, thanks a lot !
– Стас Рябцев
Nov 11 at 6:24




omg, thanks a lot !
– Стас Рябцев
Nov 11 at 6:24












oml :) (Oh my Lint)
– Yossi
Nov 11 at 6:27




oml :) (Oh my Lint)
– Yossi
Nov 11 at 6:27

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53245831%2freact-redux-parsing-error-unexpected-character%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







這個網誌中的熱門文章

How to read a connectionString WITH PROVIDER in .NET Core?

Node.js Script on GitHub Pages or Amazon S3

Museum of Modern and Contemporary Art of Trento and Rovereto