andreasonny83 / angular2-cookie-law

Angular2+ component that provides a banner to inform users about cookie law
https://stackblitz.com/edit/angular2-cookie-law
MIT License
37 stars 24 forks source link

App compiles with errors #44

Closed janstapel closed 5 years ago

janstapel commented 5 years ago

Following the documentation I get following errors:

ERROR in ../../../../node_modules/angular2-cookie-law/lib/angular2-cookie-law-container.component.d.ts(8,38): error TS2307: Cannot find module '@angular/core'. ../../../../node_modules/angular2-cookie-law/lib/angular2-cookie-law.component.d.ts(8,38): error TS2307: Cannot find module '@angular/core'. ../../../../node_modules/angular2-cookie-law/lib/angular2-cookie-law.component.d.ts(9,40): error TS2307: Cannot find module '@angular/platform-browser'.

The modules are all present and imported in 'app.module.ts' Running Angular/cli 8.3.2

andreasonny83 commented 5 years ago

Thanks for reporting @janstapel . I'll give that a go and let you know. I never tested with Angular@8 so far

andreasonny83 commented 5 years ago

Hey @janstapel . I just installed Angular cli 8 on my machine and everything seems working fine on a new project. Can you confirm you have installed angular/animations as per the documentation? Your app.module.ts should look like this:

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { CookieLawModule } from 'angular2-cookie-law';

import { AppComponent } from './app.component';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    BrowserAnimationsModule,
    CookieLawModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }
janstapel commented 5 years ago

Hey @andreasonny83 thank you for caring. I re-installed the packages and it works now. I cannot figure out what caused the problem the first time..

andreasonny83 commented 5 years ago

I'm glad it's working now. Thanks for the update