Skip to content
This repository has been archived by the owner on Feb 21, 2024. It is now read-only.

Unexpected Token #24

Open
mfs780 opened this issue Sep 15, 2016 · 5 comments
Open

Unexpected Token #24

mfs780 opened this issue Sep 15, 2016 · 5 comments

Comments

@mfs780
Copy link

mfs780 commented Sep 15, 2016

I get the following error when running npm start
ERROR in ./src/index.js
Module parse failed: src\index.js Unexpected token (43:8)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected token (43:8)
at Parser.pp$4.raise (\node_modules\webpack\node_modules\acorn\dist\acorn.js:2221:15)
at Parser.pp.unexpected (\node_modules\webpack\node_modules\acorn\dist\acorn.js:603:10)
at Parser.pp$3.parseExprAtom (\node_modules\webpack\node_modules\acorn\dist\acorn.js:1822:12)
at Parser.pp$3.parseExprSubscripts (\node_modules\webpack\node_modules\acorn\dist\acorn.js:1715:21)
at Parser.pp$3.parseMaybeUnary (\node_modules\webpack\node_modules\acorn\dist\acorn.js:1692:19)
at Parser.pp$3.parseExprOps (\node_modules\webpack\node_modules\acorn\dist\acorn.js:1637:21)
at Parser.pp$3.parseMaybeConditional (\node_modules\webpack\node_modules\acorn\dist\acorn.js:1620:21)
at Parser.pp$3.parseMaybeAssign (\node_modules\webpack\node_modules\acorn\dist\acorn.js:1597:21)
at Parser.pp$3.parseExprList (\node_modules\webpack\node_modules\acorn\dist\acorn.js:2165:22)
at Parser.pp$3.parseSubscripts (\node_modules\webpack\node_modules\acorn\dist\acorn.js:1741:35)
@ multi main

@douglascorrea
Copy link
Owner

douglascorrea commented Sep 15, 2016

@mfs780 did you run npm install first? It seems that it is not recognizing the JSX on index.js, which probably means that the react library is not in your project, which should get set by npm install

@mfs780
Copy link
Author

mfs780 commented Sep 16, 2016

@douglascorrea So I did a npm install and was still getting the issue. I decided to download the git repo in a fresh directly and follow the npm install and then npm start -s steps again. This time it runs but gives the following error.

ERROR in ./src/api/firebase.js
Module not found: Error: Cannot resolve module 'firebase/firebase-browser' in \react-hot-redux-firebase-starter-master\src\api
@ ./src/api/firebase.js 9:23-59

The website opens up to localhost:3000 to a blank screen. The console shows the following error
Uncaught Error: Cannot find module "firebase/firebase-browser"

@mfs780
Copy link
Author

mfs780 commented Sep 16, 2016

I was able to fix the issue by changing the following in /src/api/firebase.js

import * as firebase from 'firebase/firebase-browser'; to import * as firebase from 'firebase';

@douglascorrea
Copy link
Owner

@mfs780 thanks for the investigation

With your input I found the problem. Firebase recently changed their API removing browser (https://firebase.google.com/support/release-notes/js#wzxhzdk16version_310_-_june_28_2016wzxhzdk17) specific api.

As the package.json has ^3.0.3 version for Firebase, any updates below v4 will be used which should not break apis, but Firebase do not follow that.

So I need to update the code as you suggested.

But I also need to make a cleanup on everything. So will do it as soon I get the entire cleanup done, or, if you wanna help, fell fee to submit a PR.

:)

@mfs780
Copy link
Author

mfs780 commented Sep 16, 2016

Actually I just found the source of the initial problem. If I am running Visual Studio Code at the time I run npm start it causes the above mentioned error with index.js.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants