node-react-ecommerce icon indicating copy to clipboard operation
node-react-ecommerce copied to clipboard

babel_parse_error

Open reactdevFe opened this issue 5 years ago • 10 comments

when i try to run the server i get this error

image

SyntaxError: C:\Users\no one\Desktop\root3\myWeb\backend\server.js: Unexpected token (15:21)

13 | const mongodbUrl =config.MONGODB_URL; 14 | mongoose.connect(mongodbUrl, {

15 | useNewUrlParser = true, | ^ 16 | useUnifiedTopology: true, 17 | useCreateIndex: true, 18 | }).catch(error => console.log(error.reason)); at Parser._raise (C:\Users\no one\Desktop\root3\myWeb\node_modules@babel\parser\lib\index.js:746:17) at Parser.raiseWithData (C:\Users\no one\Desktop\root3\myWeb\node_modules@babel\parser\lib\index.js:739:17) at Parser.raise (C:\Users\no one\Desktop\root3\myWeb\node_modules@babel\parser\lib\index.js:733:17) at Parser.unexpected (C:\Users\no one\Desktop\root3\myWeb\node_modules@babel\parser\lib\index.js:8807:16) at Parser.checkExpressionErrors (C:\Users\no one\Desktop\root3\myWeb\node_modules@babel\parser\lib\index.js:8905:12) at Parser.parseMaybeAssign (C:\Users\no one\Desktop\root3\myWeb\node_modules@babel\parser\lib\index.js:9469:12) at Parser.parseExprListItem (C:\Users\no one\Desktop\root3\myWeb\node_modules@babel\parser\lib\index.js:10792:18) at Parser.parseCallExpressionArguments (C:\Users\no one\Desktop\root3\myWeb\node_modules@babel\parser\lib\index.js:9850:22) at Parser.parseSubscript (C:\Users\no one\Desktop\root3\myWeb\node_modules@babel\parser\lib\index.js:9750:31) at Parser.parseSubscripts (C:\Users\no one\Desktop\root3\myWeb\node_modules@babel\parser\lib\index.js:9679:19) { loc: Position { line: 15, column: 21 }, pos: 407, code: 'BABEL_PARSE_ERROR' } [nodemon] app crashed - waiting for file changes before starting...

reactdevFe avatar Jun 02 '20 19:06 reactdevFe

It happens locally or just when you are publishing on heroku?

On Tue, Jun 2, 2020 at 11:56 PM O-mrabet [email protected] wrote:

SyntaxError: C:\Users\no one\Desktop\root3\myWeb\backend\server.js: Unexpected token (15:21)

13 | const mongodbUrl =config.MONGODB_URL; 14 | mongoose.connect(mongodbUrl, {

15 | useNewUrlParser = true, | ^ 16 | useUnifiedTopology: true, 17 | useCreateIndex: true, 18 | }).catch(error => console.log(error.reason)); at Parser._raise (C:\Users\no one\Desktop\root3\myWeb\node_modules@babel \parser\lib\index.js:746:17) at Parser.raiseWithData (C:\Users\no one\Desktop\root3\myWeb\node_modules@babel\parser\lib\index.js:739:17) at Parser.raise (C:\Users\no one\Desktop\root3\myWeb\node_modules@babel \parser\lib\index.js:733:17) at Parser.unexpected (C:\Users\no one\Desktop\root3\myWeb\node_modules@babel\parser\lib\index.js:8807:16) at Parser.checkExpressionErrors (C:\Users\no one\Desktop\root3\myWeb\node_modules@babel\parser\lib\index.js:8905:12) at Parser.parseMaybeAssign (C:\Users\no one\Desktop\root3\myWeb\node_modules@babel\parser\lib\index.js:9469:12) at Parser.parseExprListItem (C:\Users\no one\Desktop\root3\myWeb\node_modules@babel\parser\lib\index.js:10792:18) at Parser.parseCallExpressionArguments (C:\Users\no one\Desktop\root3\myWeb\node_modules@babel\parser\lib\index.js:9850:22) at Parser.parseSubscript (C:\Users\no one\Desktop\root3\myWeb\node_modules@babel\parser\lib\index.js:9750:31) at Parser.parseSubscripts (C:\Users\no one\Desktop\root3\myWeb\node_modules@babel\parser\lib\index.js:9679:19) { loc: Position { line: 15, column: 21 }, pos: 407, code: 'BABEL_PARSE_ERROR' } [nodemon] app crashed - waiting for file changes before starting...

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/basir/node-react-ecommerce/issues/30, or unsubscribe https://github.com/notifications/unsubscribe-auth/AATUFQ74EVYHP2SMBOJSQZLRUVG5PANCNFSM4NRAJ2FQ .

basir avatar Jun 03 '20 05:06 basir

it happens locally

reactdevFe avatar Jun 03 '20 07:06 reactdevFe

compare your code with this: https://github.com/basir/node-react-ecommerce/commit/413eac0250c587719de78d37f5c0efb890284ab8#diff-e56633f72ecc521128b3db6586074d2c

On Wed, Jun 3, 2020 at 12:25 PM O-mrabet [email protected] wrote:

it happens locally

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/basir/node-react-ecommerce/issues/30#issuecomment-638028160, or unsubscribe https://github.com/notifications/unsubscribe-auth/AATUFQ4ENGLGAB7QANGYMVDRUX6XHANCNFSM4NRAJ2FQ .

basir avatar Jun 03 '20 07:06 basir

its the same

reactdevFe avatar Jun 03 '20 08:06 reactdevFe

exept for the server cuz u changed it later in the course

reactdevFe avatar Jun 03 '20 08:06 reactdevFe

in line 15 instead of = use :

basir avatar Jun 03 '20 10:06 basir

What do i do instead of use

reactdevFe avatar Jun 03 '20 11:06 reactdevFe

instead of the equal sign(=) use colon(:).

basir avatar Jun 03 '20 11:06 basir

IT WORKED! Thank You So Much

reactdevFe avatar Jun 03 '20 11:06 reactdevFe

you are welcome

On Wed, Jun 3, 2020 at 4:26 PM O-mrabet [email protected] wrote:

IT WORKED! Thank You So Much

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/basir/node-react-ecommerce/issues/30#issuecomment-638149282, or unsubscribe https://github.com/notifications/unsubscribe-auth/AATUFQ76IKXQ4J5YZDVBNXDRUY3APANCNFSM4NRAJ2FQ .

basir avatar Jun 03 '20 12:06 basir