error generating angular build /material

Asked

Viewed 52 times

0

When I turn the serve appears this error and does not load my components is displaying the following error that I can not solve:

-Console- main.ts:13 Error: No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document. at new PathLocationStrategy (common.js:453) at provideLocationStrategy (router.js:5533) at _callFactory (core.js:21286) at _createProviderInstance (core.js:21238) at initNgModule (core.js:21168) at new NgModuleRef_ (core.js:21895) at createNgModuleRef (core.js:21884) at Object.debugCreateNgModuleRef [as createNgModuleRef] (core.js:23715) at >NgModuleFactory_.push../node_modules/@angular/core/fesm5/core.js.NgModuleFactory_.create (core.js:24419) at core.js:17765

Filing cabinet main.ts

import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import 'hammerjs';

import { AppModule } from './app/app.module';
import { environment } from './environments/environment';

if (environment.production) {
  enableProdMode();
}

platformBrowserDynamic().bootstrapModule(AppModule)
  .catch(err => console.error(err));
  • This helps, https://angular.io/api/common/AP_BASE_HREF?

  • Thank you. helped me a lot.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.