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

Add support for Angular 16 #170

Open
mcfdez opened this issue May 5, 2023 · 6 comments
Open

Add support for Angular 16 #170

mcfdez opened this issue May 5, 2023 · 6 comments

Comments

@mcfdez
Copy link

mcfdez commented May 5, 2023

When updating the Angular app to the latest version (16.0.0), the ngx-facebook module throws the following error:

Error: node_modules/ngx-facebook/facebook.module.d.ts:28:23 - error NG6005: FacebookModule.forRoot returns a ModuleWithProviders type without a generic type argument. Please add a generic type argument to the ModuleWithProviders type. If this occurrence is in library code you don't control, please contact the library authors.

static forRoot(): ModuleWithProviders;

Can you please add support for this version?

Thank you

@hipperbyte
Copy link

Same issue here, please help us.

@Randima-Lahiru
Copy link

same issues here. any update about this?

@JomaKar
Copy link

JomaKar commented Apr 13, 2024

same here, pretty sad

@hsq125
Copy link

hsq125 commented Jun 3, 2024

+1 please 👍

@donc-py
Copy link

donc-py commented Jul 6, 2024

Any solution?

@hsq125
Copy link

hsq125 commented Oct 26, 2024

Here is a solution to package the package in a permant way, until the library is fixed.

✔️ Tested on Angular 18.
🟥 not working on a build server that provide the lib in read only :(

The patch-package tool allows you to make changes directly in node_modules and persist them through version control, so they don't get overwritten on reinstalling dependencies.

1. Install patch-package

npm install patch-package

2. Edit the facebook.module.d.ts File

Open node_modules/ngx-facebook/facebook.module.d.ts.
Update the line to include the required type argument like so:

static forRoot(): ModuleWithProviders<FacebookModule>;

3. Save the Patch

After editing, run:

npx patch-package ngx-facebook

This will create a patch file under a patches directory in your project.

4. Automate the Patch Application

Add the following script to package.json to ensure patches apply after every npm install:

"scripts": {
  "postinstall": "patch-package"
}

patch-package saves your fix as a patch that automatically re-applies each time you install or update your packages, ensuring the fix remains consistent across installs.

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

6 participants