-
-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Webpack 2 TypeError: ngAnnotate options #31
Comments
I ran into the exact same issue and realized I forgot to append "-loader". Try changing 'ng-annotate' to 'ng-annotate-loader':
|
Just curious @Cornally -- did you actually get this to work with webpack 2? I am trying this out and it does not actually annotate anything (and I have everything marked up with 'ngInject') |
Correct, it's working with webpack 2.1.0-beta.27. I didn't flag anything with 'ngInject' and ended up setting e.g -- |
Interesting, did you have babel turn your modules into commonjs? I'm was using the preset: ["es2015", {"modules": false}] so that webpack-2 can use tree-shaking (when I was using babel) and it wasn't working at all. Right now I'm seeing this error when I log the result of ngAnnotate inside the loader:
Edit: what's also is interesting is that I see in the 'es6' option doesn't actually exist in ng-annotate! It was proposed but rejected here: olov/ng-annotate#241 Edit2: Yeah, that must be what happened. When I switched typescript to use commonjs instead of es6 modules it started working -- unfortunately that means webpack cannot use tree shaking :( |
I'm using the same preset. Here are the contents of my Which loader file is complaining and on which line is the error being thrown? |
Wait, I see you have another plugin running -- angularjs-annotate -- I believe it's actually the angularjs-annotate plugin with babel that's doing the annotation for you -- not this loader. |
Look at that, you're right. For what it's worth, I just yanked this loader and as noted, I'm letting |
adding to @Cornally's answer, |
I'm having the same problem as @pselden, and I am not using babel. Is there a workaround for this, or do I have to choose between "no tree shaking" and "start using Babel" to use |
@pselden error [ 'error: couldn't process source due to parse error', |
I got the same problem. In my case, I'm not using Babel, just plain ES6 with imports/exports. Because of that, I ended using You can specify a different
More details here: |
From ng-annotate doc: So:
|
I have tried to migrate to
webpack@^2.1.0-beta.27
however I am struggling with a strange options error. This is pointing to the ng-annotate options input is null?I have attached my truncated webpack config below:
The text was updated successfully, but these errors were encountered: