just-jeb / angular-builders

Angular build facade extensions (Jest and custom webpack configuration)
MIT License
1.14k stars 198 forks source link

Angular 7, @angular-builders/custom-webpack - 7.5.2, rxjs - 6.3.3. Throws error when I run npm start. #1470

Closed ss94866 closed 7 months ago

ss94866 commented 1 year ago

Describe the Bug

When I run "npm start", it throws error. Kindly find the error below https://github.com/iamsurajdc/Angular-Todo-Application

image

Minimal Reproduction

Install @angular-builders/custom-webpack change angular.json file

"builder": "@angular-builders/custom-webpack:browser", "options": { "customWebpackConfig": { "path": "src/custom-webpack.config.ts" }, "builder": "@angular-builders/custom-webpack:dev-server",

create src/custom-webpack.config.ts const Dotenv = require("dotenv-webpack");

module.exports = { plugins: [new Dotenv()] }

run npm start to serve the application

Screenshots

If applicable, add screenshots to help explain your problem.

Environment

Libs

For Tooling issues:

just-jeb commented 1 year ago

Can you provide a link to a repo with minimal reproduction please?

ss94866 commented 1 year ago

Please find my repo URL https://github.com/ss94866/angular7-webpack

just-jeb commented 1 year ago

I'm not getting the same error you are. This is what I get, and that's because v7 doesn't support TS webpack config.

image

Regardless, your issue is a non-compatible version of Angular CLI (and Custom Webpack builder) and @angular-devkit/build-angular. You're using v7 with v0.13.0 (which is compatible with v13).
If you wish to go for Angular 7 you should be using @angular-devkit/build-angular@~0.7.0.

I would highly recommend, however, to not use Angular 7 as it is waaaay outdated (we're at version 16 now).

ss94866 commented 1 year ago

No, this isn't the error that I shared you above. import works for me. I am getting error as below.

Builder '@angular-builders/custom-webpack:dev-server' cannot be resolved. Error: Builder '@angular-builders/custom-webpack:dev-server' cannot be resolved. at MergeMapSubscriber._loadJsonFile.pipe.operators_1.concatMap [as project] (C:\Users\SIVASANKAR\Downloads\Angular-Todo-Application-master (2)\angular7-webpack\node_modules\@angular-devkit\architect\src\architect-legacy.js:169:46) at MergeMapSubscriber._tryNext (C:\Users\SIVASANKAR\Downloads\Angular-Todo-Application-master (2)\angular7-webpack\node_modules\rxjs\internal\operators\mergeMap.js:69:27) at MergeMapSubscriber._next (C:\Users\SIVASANKAR\Downloads\Angular-Todo-Application-master (2)\angular7-webpack\node_modules\rxjs\internal\operators\mergeMap.js:59:18) at MergeMapSubscriber.Subscriber.next (C:\Users\SIVASANKAR\Downloads\Angular-Todo-Application-master (2)\angular7-webpack\node_modules\rxjs\internal\Subscriber.js:67:18) at MergeMapSubscriber.notifyNext (C:\Users\SIVASANKAR\Downloads\Angular-Todo-Application-master (2)\angular7-webpack\node_modules\rxjs\internal\operators\mergeMap.js:92:26) at InnerSubscriber._next (C:\Users\SIVASANKAR\Downloads\Angular-Todo-Application-master (2)\angular7-webpack\node_modules\rxjs\internal\InnerSubscriber.js:28:21) at InnerSubscriber.Subscriber.next (C:\Users\SIVASANKAR\Downloads\Angular-Todo-Application-master (2)\angular7-webpack\node_modules\rxjs\internal\Subscriber.js:67:18) at MergeMapSubscriber.notifyNext (C:\Users\SIVASANKAR\Downloads\Angular-Todo-Application-master (2)\angular7-webpack\node_modules\rxjs\internal\operators\mergeMap.js:92:26) at InnerSubscriber._next (C:\Users\SIVASANKAR\Downloads\Angular-Todo-Application-master (2)\angular7-webpack\node_modules\rxjs\internal\InnerSubscriber.js:28:21) at InnerSubscriber.Subscriber.next (C:\Users\SIVASANKAR\Downloads\Angular-Todo-Application-master (2)\angular7-webpack\node_modules\rxjs\internal\Subscriber.js:67:18) at C:\Users\SIVASANKAR\Downloads\Angular-Todo-Application-master (2)\angular7-webpack\node_modules\rxjs\internal\util\subscribeTo.js:17:28 at Object.subscribeToResult (C:\Users\SIVASANKAR\Downloads\Angular-Todo-Application-master (2)\angular7-webpack\node_modules\rxjs\internal\util\subscribeToResult.js:10:45) at MergeMapSubscriber._innerSub (C:\Users\SIVASANKAR\Downloads\Angular-Todo-Application-master (2)\angular7-webpack\node_modules\rxjs\internal\operators\mergeMap.js:82:29) at MergeMapSubscriber._tryNext (C:\Users\SIVASANKAR\Downloads\Angular-Todo-Application-master (2)\angular7-webpack\node_modules\rxjs\internal\operators\mergeMap.js:76:14) at MergeMapSubscriber._next (C:\Users\SIVASANKAR\Downloads\Angular-Todo-Application-master (2)\angular7-webpack\node_modules\rxjs\internal\operators\mergeMap.js:59:18) at MergeMapSubscriber.Subscriber.next (C:\Users\SIVASANKAR\Downloads\Angular-Todo-Application-master (2)\angular7-webpack\node_modules\rxjs\internal\Subscriber.js:67:18) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! angular-crash-todolist@0.0.0 start:ng serve` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the angular-crash-todolist@0.0.0 start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\SIVASANKAR\AppData\Roaming\npm-cache_logs\2023-09-06T06_26_38_777Z-debug.log `

just-jeb commented 1 year ago

Have you read the rest of my comment or just the beginning?

arturovt commented 7 months ago

Closing since the 7 version has been deprecated long time ago.