Skip to content

Issue with Filestack being recognized in Angular 14Β #66

Open
@TravisCallahan

Description

@TravisCallahan

I've been attempting to upgrade an Angular application from 12 to 14 and have been having issues getting filestack to be recognized. 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 docs, I 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';

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions