Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with Filestack being recognized in Angular 14 #66

Open
TravisCallahan opened this issue Jan 26, 2024 · 3 comments
Open

Issue with Filestack being recognized in Angular 14 #66

TravisCallahan opened this issue Jan 26, 2024 · 3 comments

Comments

@TravisCallahan
Copy link

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';

@AliLozano
Copy link

AliLozano commented Feb 12, 2024

Hello, I have the same issue with angular 16, any news about this?.

Thanks.

@TravisCallahan
Copy link
Author

@AliLozano in our case, we were able to get it to work on Angular 14 by using version 1.4.0 of filestack. I had to do a force npm install.

@AliLozano
Copy link

AliLozano commented Feb 12, 2024

@TravisCallahan Thank you very much, I will do the same

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants