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

Building a library alongside with Ivy and non-Ivy transpilation for retrocompatibility #95

Closed
arunreghu opened this issue Oct 21, 2022 · 5 comments
Labels
enhancement willfix will be fixed asap

Comments

@arunreghu
Copy link

arunreghu commented Oct 21, 2022

@davi01100100 @gethinoakes @dfa1234 @byronigoe @davi01100100 I am using ngx-image-compress-legacy plugin for my angular project(Angular verision 8) . Plugin works in local host when ng serve. but it throws error when trying to take production build(ng build --prod).
ERROR in ./src/app/admin/transactions/edit-transaction-modal.component.ngfactory.js Module not found: Error: Can't resolve 'ngx-image-compress' in 'C:\angular\src\app\admin\transactions'

I import 'NgxImageCompressService' in my component.ts and module file like following.
in component file

import { NgxImageCompressService } from ngx-image-compress-legacy;
constructor(){private imageCompress: NgxImageCompressService}

in module file

import {NgxImageCompressService} from "ngx-image-compress-legacy";
providers: [NgxImageCompressService]

Its Works in local(ng serve) but throw error in build(ng build --prod).

@arunreghu
Copy link
Author

Screenshot_32

@bh
Copy link

bh commented May 24, 2023

Successfull workaround:

diff --git a/packages/app/tsconfig.json b/packages/app/tsconfig.json
index f9f9325..95e65ed 100644
--- a/packages/app/tsconfig.json
+++ b/packages/app/tsconfig.json
@@ -12,7 +12,8 @@
             ],
             "@ngxs/*": [
                 "./node_modules/@angular/*"
-            ]
+            ],
+            "ngx-image-compress": ["node_modules/ngx-image-compress-legacy"]
         },
     },
     "angularCompilerOptions": {

@heyjudemaldicas
Copy link

dfa1234 any updates on this? encountering same issue.

@dfa1234
Copy link
Owner

dfa1234 commented Jun 16, 2023

@heyjudemaldicas @bh @arunreghu it's not impossible to fix this very soon, but it's somewhat complicated.
I don't want to work on 2 libraries.
So I would just package 1 library with the ivy compilation and the non-ivy.
But angular is not doing that out of the box (ng-packagr push you to drop old format...)
Only solution would be to work on some script doing this for us.
Like doing an angular 11 compilation (I tested it and 11 is fine)
Then a angular 15 or 16
And mixing the 2 in one library
I'm thinking a lot to do it soon, because supporting a very wide range of angular app is one of the goal of this library.
And could be used elsewhere

@dfa1234 dfa1234 added willfix will be fixed asap and removed to be investigated labels Jun 16, 2023
@dfa1234 dfa1234 changed the title Build error when using ngx-image-compress-legacy Building a library alongside with Ivy and non-Ivy transpilation for retrocompatibility Jun 16, 2023
@dfa1234 dfa1234 mentioned this issue Jun 16, 2023
@dfa1234
Copy link
Owner

dfa1234 commented Jul 22, 2024

This is done.

Please use

npm install ngx-image-compress@8.12.2

@dfa1234 dfa1234 closed this as completed Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement willfix will be fixed asap
Projects
None yet
Development

No branches or pull requests

4 participants