andrey-skl / ng-annotate-loader

Webpack loader to annotate angular applications
MIT License
120 stars 28 forks source link

webpack 2.4.0 breaks ng-annotate loader #38

Closed nstuyvesant closed 7 years ago

nstuyvesant commented 7 years ago

See the warnings and error below. Rolling back to webpack 2.3.3 solved the problem for now.

WARNING in ./~/angular/angular.js 8060:17-24 Critical dependency: require function is used in a way in which dependencies cannot be statically extracted at CommonJsRequireContextDependency.getWarnings (/Users/nates/Documents/Development/shy/node_modules/webpack/lib/dependencies/CommonJsRequireContextDependency.js:27:4) at Compilation.reportDependencyErrorsAndWarnings (/Users/nates/Documents/Development/shy/node_modules/webpack/lib/Compilation.js:668:24) at Compilation.finish (/Users/nates/Documents/Development/shy/node_modules/webpack/lib/Compilation.js:531:9) at /Users/nates/Documents/Development/shy/node_modules/webpack/lib/Compiler.js:486:16 at /Users/nates/Documents/Development/shy/node_modules/tapable/lib/Tapable.js:225:11 at _addModuleChain (/Users/nates/Documents/Development/shy/node_modules/webpack/lib/Compilation.js:477:11) at processModuleDependencies.err (/Users/nates/Documents/Development/shy/node_modules/webpack/lib/Compilation.js:448:13) at _combinedTickCallback (internal/process/next_tick.js:73:7) at process._tickCallback (internal/process/next_tick.js:104:9)

WARNING in ./~/angular/angular.js 8060:38-45 Critical dependency: require function is used in a way in which dependencies cannot be statically extracted at CommonJsRequireContextDependency.getWarnings (/Users/nates/Documents/Development/shy/node_modules/webpack/lib/dependencies/CommonJsRequireContextDependency.js:27:4) at Compilation.reportDependencyErrorsAndWarnings (/Users/nates/Documents/Development/shy/node_modules/webpack/lib/Compilation.js:668:24) at Compilation.finish (/Users/nates/Documents/Development/shy/node_modules/webpack/lib/Compilation.js:531:9) at /Users/nates/Documents/Development/shy/node_modules/webpack/lib/Compiler.js:486:16 at /Users/nates/Documents/Development/shy/node_modules/tapable/lib/Tapable.js:225:11 at _addModuleChain (/Users/nates/Documents/Development/shy/node_modules/webpack/lib/Compilation.js:477:11) at processModuleDependencies.err (/Users/nates/Documents/Development/shy/node_modules/webpack/lib/Compilation.js:448:13) at _combinedTickCallback (internal/process/next_tick.js:73:7) at process._tickCallback (internal/process/next_tick.js:104:9)

WARNING in ./~/angular/angular.js 8061:14-21 Critical dependency: require function is used in a way in which dependencies cannot be statically extracted at CommonJsRequireContextDependency.getWarnings (/Users/nates/Documents/Development/shy/node_modules/webpack/lib/dependencies/CommonJsRequireContextDependency.js:27:4) at Compilation.reportDependencyErrorsAndWarnings (/Users/nates/Documents/Development/shy/node_modules/webpack/lib/Compilation.js:668:24) at Compilation.finish (/Users/nates/Documents/Development/shy/node_modules/webpack/lib/Compilation.js:531:9) at /Users/nates/Documents/Development/shy/node_modules/webpack/lib/Compiler.js:486:16 at /Users/nates/Documents/Development/shy/node_modules/tapable/lib/Tapable.js:225:11 at _addModuleChain (/Users/nates/Documents/Development/shy/node_modules/webpack/lib/Compilation.js:477:11) at processModuleDependencies.err (/Users/nates/Documents/Development/shy/node_modules/webpack/lib/Compilation.js:448:13) at _combinedTickCallback (internal/process/next_tick.js:73:7) at process._tickCallback (internal/process/next_tick.js:104:9)

WARNING in ./~/angular/angular.js 8064:19-26 Critical dependency: require function is used in a way in which dependencies cannot be statically extracted at CommonJsRequireContextDependency.getWarnings (/Users/nates/Documents/Development/shy/node_modules/webpack/lib/dependencies/CommonJsRequireContextDependency.js:27:4) at Compilation.reportDependencyErrorsAndWarnings (/Users/nates/Documents/Development/shy/node_modules/webpack/lib/Compilation.js:668:24) at Compilation.finish (/Users/nates/Documents/Development/shy/node_modules/webpack/lib/Compilation.js:531:9) at /Users/nates/Documents/Development/shy/node_modules/webpack/lib/Compiler.js:486:16 at /Users/nates/Documents/Development/shy/node_modules/tapable/lib/Tapable.js:225:11 at _addModuleChain (/Users/nates/Documents/Development/shy/node_modules/webpack/lib/Compilation.js:477:11) at processModuleDependencies.err (/Users/nates/Documents/Development/shy/node_modules/webpack/lib/Compilation.js:448:13) at _combinedTickCallback (internal/process/next_tick.js:73:7) at process._tickCallback (internal/process/next_tick.js:104:9)

WARNING in ./~/angular/angular.js 8068:11-18 Critical dependency: require function is used in a way in which dependencies cannot be statically extracted at CommonJsRequireContextDependency.getWarnings (/Users/nates/Documents/Development/shy/node_modules/webpack/lib/dependencies/CommonJsRequireContextDependency.js:27:4) at Compilation.reportDependencyErrorsAndWarnings (/Users/nates/Documents/Development/shy/node_modules/webpack/lib/Compilation.js:668:24) at Compilation.finish (/Users/nates/Documents/Development/shy/node_modules/webpack/lib/Compilation.js:531:9) at /Users/nates/Documents/Development/shy/node_modules/webpack/lib/Compiler.js:486:16 at /Users/nates/Documents/Development/shy/node_modules/tapable/lib/Tapable.js:225:11 at _addModuleChain (/Users/nates/Documents/Development/shy/node_modules/webpack/lib/Compilation.js:477:11) at processModuleDependencies.err (/Users/nates/Documents/Development/shy/node_modules/webpack/lib/Compilation.js:448:13) at _combinedTickCallback (internal/process/next_tick.js:73:7) at process._tickCallback (internal/process/next_tick.js:104:9)

ERROR in vendor.5c6ef097cfa31aecffbc.js from UglifyJs Invalid assignment [./~/ng-annotate-loader/loader.js?single_quotes!./~/angular/angular.js:8064,0][vendor.5c6ef097cfa31aecffbc.js:44004,150]

Here's the element in my webpack modules.rules array:

        {
          test: /\.js$/,
          loader: 'ng-annotate-loader?single_quotes',
          enforce: 'post'
        }
nstuyvesant commented 7 years ago

Solved by webpack 2.4.1

andrey-skl commented 7 years ago

@nstuyvesant Good news, thank you for sharing your experience!