Cannot read property 'baseHref' of undefined
See original GitHub issueDescribe the bug
When using ng serve, I get this:
Cannot read property 'baseHref' of undefined
TypeError: Cannot read property 'baseHref' of undefined
at GenericDevServerBuilder._buildServePath (/Users/seiyria/GitHub/deck-zone-ng7/node_modules/@angular-devkit/build-angular/src/dev-server/index.js:233:80)
at GenericDevServerBuilder._buildServerConfig (/Users/seiyria/GitHub/deck-zone-ng7/node_modules/@angular-devkit/build-angular/src/dev-server/index.js:123:32)
at GenericDevServerBuilder._buildServerConfig (/Users/seiyria/GitHub/deck-zone-ng7/node_modules/@angular-builders/dev-server/src/generic/index.js:11:109)
at MergeMapSubscriber.check_port_1.checkPort.pipe.operators_1.concatMap [as project] (/Users/seiyria/GitHub/deck-zone-ng7/node_modules/@angular-devkit/build-angular/src/dev-server/index.js:41:47)
at MergeMapSubscriber._tryNext (/Users/seiyria/GitHub/deck-zone-ng7/node_modules/rxjs/internal/operators/mergeMap.js:69:27)
at MergeMapSubscriber._next (/Users/seiyria/GitHub/deck-zone-ng7/node_modules/rxjs/internal/operators/mergeMap.js:59:18)
at MergeMapSubscriber.Subscriber.next (/Users/seiyria/GitHub/deck-zone-ng7/node_modules/rxjs/internal/Subscriber.js:67:18)
at TapSubscriber._next (/Users/seiyria/GitHub/deck-zone-ng7/node_modules/rxjs/internal/operators/tap.js:65:26)
at TapSubscriber.Subscriber.next (/Users/seiyria/GitHub/deck-zone-ng7/node_modules/rxjs/internal/Subscriber.js:67:18)
at MergeMapSubscriber.notifyNext (/Users/seiyria/GitHub/deck-zone-ng7/node_modules/rxjs/internal/operators/mergeMap.js:92:26)
at InnerSubscriber._next (/Users/seiyria/GitHub/deck-zone-ng7/node_modules/rxjs/internal/InnerSubscriber.js:28:21)
at InnerSubscriber.Subscriber.next (/Users/seiyria/GitHub/deck-zone-ng7/node_modules/rxjs/internal/Subscriber.js:67:18)
at ForkJoinSubscriber.notifyComplete (/Users/seiyria/GitHub/deck-zone-ng7/node_modules/rxjs/internal/observable/forkJoin.js:82:25)
at InnerSubscriber._complete (/Users/seiyria/GitHub/deck-zone-ng7/node_modules/rxjs/internal/InnerSubscriber.js:35:21)
at InnerSubscriber.Subscriber.complete (/Users/seiyria/GitHub/deck-zone-ng7/node_modules/rxjs/internal/Subscriber.js:79:18)
at MapSubscriber.Subscriber._complete (/Users/seiyria/GitHub/deck-zone-ng7/node_modules/rxjs/internal/Subscriber.js:97:26)
To Reproduce Steps to reproduce the behavior:
https://github.com/seiyria/deck.zone/tree/ng7
npm i && npm start
Expected behavior No error when trying to serve
Builder:
- dev-server:generic & custom-webpack:browser, both at 7.2.0
Libraries
angular-devkit/build-angular
: 0.11.0
Additional context None
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:12 (6 by maintainers)
Top Results From Across the Web
TypeError: Cannot read property 'baseHref' of undefined
After updating the package.json to use to following version, it was resolved. "devDependencies": { "@angular-builders/custom-webpack": ...
Read more >Hi, got error `Cannot read property 'baseHref' of undefined` with
Has anyone met something similar ?. “Hi, got error `Cannot read property 'baseHref' of undefined` with” is published by Max Ivanov.
Read more >Error: No base href set." after upgrade to Angular 8-angular.js
Coding example for the question "Error: No base href set. ... Angular 2+ - Set base href dynamically · ERROR in Cannot read...
Read more >HTML DOM Base href Property - W3Schools
The href property sets or returns the value of the href attribute in a base element. The href attribute specifies a base URL...
Read more >Cannot read property 'baseUrl' of undefined - Bountysource
angular.js:14642 TypeError: Cannot read property 'baseUrl' of undefined at new controller (formio.js:15713)
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Issue still exists in 7.4.5 alongside devkit 0.7.5
@meltedspark
7.2.1
is working indeed! Found out that the problem was that I was usingangular-devkit/build-angular@0.11.0
. Once I upgraded it, it worked fine! Thanks 😃)