-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[Bug]: Compiler errors when using fabric.js 6.4.3 with Angular 16.2.6 #10196
Comments
fabric uses typescript 5.5.4 so far. |
I tried with 5.5.4 still the same also for me @asturur Error: node_modules/fabric/dist/src/filters/Composed.d.ts:29:5 - error TS2416: Property 'toObject' in type 'Composed' is not assignable to the same property in base type 'BaseFilter<"Composed", ComposedOwnProps>'. 29 toObject(): { Error: node_modules/fabric/dist/src/filters/HueRotation.d.ts:26:5 - error TS2416: Property 'toObject' in type 'HueRotation' is not assignable to the same property in base type 'ColorMatrix<"HueRotation", HueRotationOwnProps>'. 26 toObject(): { node_modules/fabric/dist/src/filters/ColorMatrix.d.ts:62:9 ** Angular Live Development Server is listening on localhost:4401, open your browser on http://localhost:4401/ ** × Failed to compile. |
But why those errors would not show up when building fabricJS itself? |
I am also getting the same errors with Angular 18.1.2 and Node 20.18.0. I tried installing typescript 5.5.4 and still no dice. I get the same errors as posted above. |
have you tried skipLibCheck compiler option? |
I still have this question tho, But why those errors would not show up when building fabricJS itself? |
my hunch is that they installed some packages and they augment some interfaces and then they get conflicts |
Yes, it compiles for me with skipLibCheck: true, but I can't find anyway to turn on skipLibCheck ONLY for Fabric, so it's not a real solution here. |
I see fabric also has the skipLibCheck: true in its own tsconfig |
Did someone find a solution, i'm having the same problem with version 6.0.0. |
So i wonder if those errors are muted on our side and the build process strips the muting comments? |
FabricJS can't build with errors. If you introduce a TS error the build process will exit. I think that is take care by rollup. |
I see, I am not familiar with rollup build and rollup doing the typecheck on ts codebase |
I've manage to update the angular version to 17.3.11 and typescript 5.4.5 but still no results... |
If it is critical for you try adding |
I m removing those commented options from the config: It has nothing to do with this issue but i think it was wroth pointing it out. For those errors:
as you see we have an expect error here, and rollup removing comments is also removing those ts-expect-error. we have 3 expect error in the code To have it working correctly i think we need to introduce the serializedProps in the base filter definition |
Not sure how long will take #10309 |
Please check if 6.5.3 improves the situation or not |
@asturur I tried the latest fabric and there are still type issues with imports from jsdom although nowhere in my app I use jsdom |
So did something change or is identical as before? If the only left warning is to install JSDOM types just install those. Those should be types only and shouldn't finish in your bundle at all |
@asturur it reduced
and the 3rd one is only because I have If you need a repro you can test it out here regarding jsdom types, I am using |
Maybe we can add in the docs about installing the jsdom types, and we can look into this exactOptional thing |
I think in order to fix that one issue we would need to change the I cloned the repo and tried to build it and see if I can contribute the fix |
To build the repo you can run 'npm run build'.
|
I can't get that left/top undefined error to trigger, What should i remove from my tsconfig to have it as an error? |
@asturur just uncomment this one line https://github.com/fabricjs/fabric.js/blob/master/tsconfig.json#L92 |
if we have just one error when removing the option we should remove the option imho and fix the error. |
@asturur I can't guarantee that it will be only 1 error in all projects |
CheckList
Version
6.4.3
Node Version (if applicable)
18.20.3
Link To Reproduction
https://stackblitz.com/edit/node-rjvbk2?file=src%2Fapp%2Fapp.component.ts
Steps To Reproduce
Angular 16.2.6
projectfabric.js 6.4.3
(npm install [email protected])Expected Behavior
The project should compile and serve without errors.
Actual Behavior
Multiple compiler errors occur, preventing the project from compiling successfully.
Error Message & Stack Trace
The errors seem to be related to TypeScript declarations within fabric.js itself, suggesting potential incompatibilities with
TypeScript 4.9.5
which i used in this project.When running ng serve, the following terminal output appears:
The text was updated successfully, but these errors were encountered: