Repository navigation
"Cannot read property 'match' of undefined" on ng build --prod after updating to 6.0.0-rc.* #10231
Copy link
Copy link
Closed
Description
Versions
Angular CLI: 6.0.0-rc.2
Node: 8.11.1
OS: win32 x64
Angular: 6.0.0-rc.3
... animations, common, compiler, compiler-cli, core, forms
... http, platform-browser, platform-browser-dynamic, router
@angular/cdk: 6.0.0-rc.1
@angular/cli: 6.0.0-rc.2
@angular/flex-layout: 5.0.0-beta.14
@angular/material-moment-adapter: 6.0.0-rc.1
@angular/material: 6.0.0-rc.1
@angular-devkit/architect: 0.5.4
@angular-devkit/build-angular: 0.5.4
@angular-devkit/core: 0.5.4
@angular-devkit/schematics: 0.5.4
@ngtools/json-schema: 1.1.0
@schematics/angular: 0.5.4
@schematics/update: 0.5.4
typescript: 2.7.2
webpack: 4.5.0
Repro steps
I'm not sure if the steps below are necessary to see the bug happening in Windows 10 system. These are the steps I did on my machine, and since 6.0.0-rc.0 I cannot perform ng build --prod.
- Migrate a project from earlier versions to
6.0.0-rc.0(installing cli also globally) ng update @angular/cli --migrate-only --from=1.7.1- upgrade cli to
6.0.0-rc.1and then6.0.0-rc.2 - Try to
ng build --prod
If it helps, the project I used in the tests: https://github.com/julianobrasil/material2-test
Observed behavior
Cannot read property 'match' of undefined
TypeError: Cannot read property 'match' of undefined
at Object.normalize (E:\******\node_modules\@angular-devkit\build-angular\node_modules\@angular-devkit\core\src\virtual-fs\path.js:178:14)
at options.fileReplacements.forEach (E:\******\node_modules\@angular-devkit\build-angular\src\browser\index.js:99:55)
at Array.forEach (<anonymous>)
at BrowserBuilder.buildWebpackConfig (E:\******\node_modules\@angular-devkit\build-angular\src\browser\index.js:98:34)
at Observable.rxjs_1.Observable.obs [as _subscribe] (E:\******\node_modules\@angular-devkit\build-angular\src\browser\index.js:31:38)
at Observable.subscribe (E:\******\node_modules\rxjs\internal\Observable.js:162:69)
at E:\******\node_modules\rxjs\internal\util\subscribeTo.js:22:31
at Object.subscribeToResult (E:\******\node_modules\rxjs\internal\util\subscribeToResult.js:7:45)
at MergeMapSubscriber._innerSub (E:\******\node_modules\rxjs\internal\operators\mergeMap.js:132:38)
at MergeMapSubscriber._tryNext (E:\******\node_modules\rxjs\internal\operators\mergeMap.js:129:14)
at MergeMapSubscriber._next (E:\******\node_modules\rxjs\internal\operators\mergeMap.js:112:18)
at MergeMapSubscriber.Subscriber.next (E:\******\node_modules\rxjs\internal\Subscriber.js:103:18)
at MergeMapSubscriber.notifyNext (E:\******\node_modules\rxjs\internal\operators\mergeMap.js:141:26)
at InnerSubscriber._next (E:\******\node_modules\rxjs\internal\InnerSubscriber.js:30:21)
at InnerSubscriber.Subscriber.next (E:\******\node_modules\rxjs\internal\Subscriber.js:103:18)
at MergeMapSubscriber.notifyNext (E:\******\node_modules\rxjs\internal\operators\mergeMap.js:141:26)
Desired behavior
Run ng build --prod without errors
Mention any other details that might be useful (optional)
As the error message mentions rxjs a lot, I think it's worth to tell my rxjs versions:
"rxjs": "6.0.0-rc.1"
"rxjs-compat": "6.0.0-rc.1"
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
julianobrasil commentedon Apr 8, 2018
Apparently the migration process (
--migrate-only), generated the following snippet inangular.jsonin the"configurations.production"attribute (you can check for it in the repo link I've posted above):I've tried (unsuccessfully) to replace it for:
After checking out a brand new generated project, I've switched it to:
Now it's compiling again with
ng build --prod.cc: @filipesilva
filipesilva commentedon Apr 9, 2018
Heya, I believe you ran into #10141. It was fixed for upgrading projects in rc.1 (or maybe 2).
Mathem8tic commentedon Apr 9, 2018
I had the exact same issue. Seems fixed in rc.2. Just create new from the CLI rc.2 and reintegrate your files.
angular-automatic-lock-bot commentedon Sep 8, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.