ngx-library-assets icon indicating copy to clipboard operation
ngx-library-assets copied to clipboard

Getting exeception when trying to build prod with ngx-library-assets

Open fnuMMS opened this issue 4 years ago • 4 comments

When I am trying to build a prod version of my app I am running into an exception which looks like coming from using ngx-library-assets

An unhandled exception occurred: builder is not a function

Some more logs:

verbose stack spawn ENOENT verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:48:18) verbose stack at ChildProcess.emit (events.js:315:20) verbose stack at maybeClose (internal/child_process.js:1021:16) verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)

Here are my devDependencies:

"devDependencies": { "@angular-devkit/build-angular": "^0.1100.2", "@angular-devkit/build-ng-packagr": "~0.1000.1", "@angular/cli": "~10.0.1", "@angular/compiler-cli": "~10.0.2", "@ngrx/effects": "^10.0.1", "@ngrx/router-store": "^10.0.1", "@ngrx/store": "^10.0.0", "@ngrx/store-devtools": "^10.0.0", "@types/jasmine": "~3.5.0", "@types/jasminewd2": "~2.0.3", "@types/node": "^12.11.1", "codelyzer": "^6.0.0-next.1", "jasmine-core": "~3.5.0", "jasmine-spec-reporter": "~5.0.0", "karma": "~5.0.0", "karma-chrome-launcher": "~3.1.0", "karma-coverage-istanbul-reporter": "~3.0.2", "karma-jasmine": "~3.3.0", "karma-jasmine-html-reporter": "^1.5.0", "ng-packagr": "^10.0.0", "ngx-library-assets": "^1.2.1", "protractor": "~7.0.0", "ts-node": "~8.3.0", "tslint": "~6.1.0", "typescript": "~3.9.5" }

fnuMMS avatar Dec 03 '20 11:12 fnuMMS

Hi @fnuMMS

I see you're using angular-devkit versions 0.1100.2. Are you using Angular10 or Angular11? For Angular11, there were some changes in angular-devkit. v2.0.0 of this library should work with Angular11

orjandesmet avatar Jan 12 '21 15:01 orjandesmet

Hello @orjandesmet,

I am also getting the error if I try to execute ng build --prod. The error description is below, also I have attached the package.json file. The same package.json you can use in your "example" (just replace the original one) application, the error will be the same. Any chance for some advice on how to overcome this obstacle?

Thank you

package.zip

[error] TypeError: builder is not a function at SwitchMapSubscriber.project (... ... ngx-library-assets-master\example\node_modules\ngx-library-assets\dist\browser\index.js:50:16) at SwitchMapSubscriber._next (... ... ngx-library-assets-master\example\node_modules\ngx-library-assets\node_modules\rxjs\internal\operators\switchMap.js:49:27) at SwitchMapSubscriber.Subscriber.next (... ... ngx-library-assets-master\example\node_modules\ngx-library-assets\node_modules\rxjs\internal\Subscriber.js:66:18) at ZipSubscriber.checkIterators (... ... ngx-library-assets-master\example\node_modules\ngx-library-assets\node_modules\rxjs\internal\observable\zip.js:121:25) at ZipBufferIterator.notifyNext (... ... ngx-library-assets-master\example\node_modules\ngx-library-assets\node_modules\rxjs\internal\observable\zip.js:223:21) at InnerSubscriber._next (... ... ngx-library-assets-master\example\node_modules\ngx-library-assets\node_modules\rxjs\internal\InnerSubscriber.js:28:21) at InnerSubscriber.Subscriber.next (... ... ngx-library-assets-master\example\node_modules\ngx-library-assets\node_modules\rxjs\internal\Subscriber.js:66:18) at ... ... ngx-library-assets-master\example\node_modules\ngx-library-assets\node_modules\rxjs\internal\util\subscribeToPromise.js:7:24

ShadowQueen avatar Apr 21 '21 19:04 ShadowQueen

@ShadowQueen It is indeed reproducible with that setup. Strangely it only occurs on prod builds. I'm investigating this as we speak

orjandesmet avatar Apr 22 '21 14:04 orjandesmet

I've created a new release (v1.2.2) which should fix this issue.

orjandesmet avatar Apr 22 '21 15:04 orjandesmet