Having trouble with filestack/angular when upgrading from Angular 12 to 14

19 Views Asked by At

I've been attempting to upgrade an application from 12 to 14 and have been having constant issues with filestack/angular. Here are a few examples of the errors that I'm receiving:

Error: node_modules/@filestack/angular/projects/filestack-angular/src/lib/filestack-transform.pipe.ts:14:51 - error TS2345: Argument of type 'TransformOptions | undefined' is not assignable to parameter of type 'TransformOptions'.
  Type 'undefined' is not assignable to type 'TransformOptions'.

14     return this.filestackService.transform(value, transformOptions);
                                                     ~~~~~~~~~~~~~~~~


Error: node_modules/@filestack/angular/projects/filestack-angular/src/lib/filestack.service.ts:25:11 - error TS2564: Property 'clientInstance' has no initializer and is not definitely assigned in the constructor.

25   private clientInstance: Client;
             ~~~~~~~~~~~~~~


Error: node_modules/@filestack/angular/projects/filestack-angular/src/lib/filestack.service.ts:27:11 - error TS2564: Property 'clientOptions' has no initializer and is not definitely assigned in the constructor.

27   private clientOptions: ClientOptions;
             ~~~~~~~~~~~~~


Error: node_modules/@filestack/angular/projects/filestack-angular/src/lib/filestack.service.ts:29:11 - error TS2564: Property 'apikey' has no initializer and is not definitely assigned in the constructor.     

29   private apikey: string;

According to the documentation, you need to import filestack like so:

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { FilestackModule } from '@filestack/angular';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    FilestackModule.forRoot({ apikey: YOUR_APIKEY, options: ClientConfig })
  ],
  bootstrap: [AppComponent]
})
export class AppModule {}

However I can't even get it to be recognized when I try importing it like that. The only way I've been able to get it to be recognized is by changing the import statement to:

import { FilestackModule } from '@filestack/angular/projects/filestack-angular/src/lib/filestack.module';

Any help would be much appreciated!!

0

There are 0 best solutions below