pbastowski / angular2-now

Angular 2 @Component syntax for Angular 1 apps
MIT License
145 stars 15 forks source link

Error while compiling: Unexpected token #31

Closed kamilkisiela closed 8 years ago

kamilkisiela commented 8 years ago

Error while compiling:

Babel compiling files:
  angular2-now.js
{ [SyntaxError: /packages/pbastowski_angular2-now/angular2-now.js: Unexpected to
ken (569:28)]
  pos: 23785,
  loc: { line: 569, column: 28 },
  _babel: true,
  codeFrame: '  567 | \n  568 |                             // Custom data\n> 56
9 |                             data: options.data\n      |
        ^\n  570 |                         };\n  571 | \n  572 | ' }

Startup error:

   While processing files with pbastowski:angular-babel (for target
   web.browser):
   packages/pbastowski:angular2-now/angular2-now.js:569:28: Babel
   transform error

I'm using:

angular@1.3.1
pbastowski:angular-babel@1.0.7
pbastowski:angular2-now@0.3.17
pbastowski commented 8 years ago

Could you please provide a link to a repo I can look at?

kamilkisiela commented 8 years ago

It's the private repo but I'm going to reproduce it in a moment.

kamilkisiela commented 8 years ago

@pbastowski Here it is

pbastowski commented 8 years ago

I've made changes to your repo to make it work. There were quite a few changes, so, you'll want to read the commit logs to see what I did.

Please give me push rights to the demo repo on github and I will push my changes to it.

kamilkisiela commented 8 years ago

Ok, you can check now. There were few errors in app.js but the unexpected token error was right before them. So I didn't want to push new commits with fixes, thought it was unrelated.

pbastowski commented 8 years ago

Done. I hope this helps you.

In summary:

kamilkisiela commented 8 years ago

@pbastowski Yeah, I build it as fast as I can so I didn't think about moving it to /client etc.

So basically, unexpected token error was caused by using not proper version of package? For Meteor 1.2+ I have to use angular2-now in version 1.0.0+?

pbastowski commented 8 years ago

Yes.

Any specific reason you added babel.json and babel.rc?

kamilkisiela commented 8 years ago

I think it is just a leftover. I was using your ecmascript-extra couple weeks ago.

pbastowski commented 8 years ago

OK, cool.

Closing the issue.

kamilkisiela commented 8 years ago

@pbastowski My app was working right, but then I updated packages below and got error:

pbastowski:angular-babel@1.0.6 to 1.0.7 angular@1.3.0 to 1.3.1 pbastowski:angular2-now@0.3.15 to 0.3.17 without changes

I will use angular2-now 1.0+ version so you can close issue.

pbastowski commented 8 years ago

Do you mean to say that meteor update gives you "angular2-now@0.3.15" automatically?

kamilkisiela commented 8 years ago

I set @0.3.17 manually to one of my package

pbastowski commented 8 years ago

Why not use @1.0.2? Are you using Meteor 1.1?

kamilkisiela commented 8 years ago

I recently moved my app to Meteor 1.2. Ok, now I'm going to use @1.0.2.

Thanks for your help and angular2-now :)

pbastowski commented 8 years ago

You are welcome.