-
Notifications
You must be signed in to change notification settings - Fork 310
'Uncaught SyntaxError: Unexpected token =' on optional parameter #442
Comments
Which version of Node.js are you using ? |
My Node.js version is 6.9.1. My npm version is 4.0.3. My Typescript version is 2.2.1. |
Can you try updating your node version to the latests (v8.1.4 i think) ? |
@giwiro I've seen a working example from someone on Stack Overflow who used Node 7.7.1. I've updated to that one and I still get the same error. Do you happen to know what version of angular I should be using? Here is my package.json file:
|
Hello, Hope that helps ;) |
@nmt1994 I'm using Chrome. |
I've upgraded to Angular 4, and I'm still getting the same error. This is my current package.json:
|
@giwiro @nmt1994 Okay, I believe this is related to my tsconfig.json, not package.json. I'm using:
As you can see, I am using es6 as my target in compilerOptions. Every example I've seen has been using es5. I downgraded es6 to es5 in my tsconfig.json and the error no longer occurs (though now I get some errors which are a result of the downgrade, but unrelated to ngrx). |
I'm trying to add ngrx/store to my Angular app. A lot of tutorials/introductions go over a simple counter with a reducer function that looks like:
Whenever I run my app, I get the following error:
Uncaught SyntaxError: Unexpected token =
Does anyone know why this is happening? It complains about the second '=' sign, the optional parameter. Almost every ngrx/store counter tutorial I've seen uses this function syntax, yet my system throws an error.
The text was updated successfully, but these errors were encountered: