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

[Bug]: <FabricImage>.fromURL() simply does not work. #9992

Closed
7 tasks done
TimChinye opened this issue Jul 12, 2024 · 4 comments
Closed
7 tasks done

[Bug]: <FabricImage>.fromURL() simply does not work. #9992

TimChinye opened this issue Jul 12, 2024 · 4 comments

Comments

@TimChinye
Copy link

TimChinye commented Jul 12, 2024

CheckList

  • I agree to follow this project's Code of Conduct
  • I have read and followed the Contributing Guide
  • I have read and followed the Issue Tracker Guide
  • I have searched and referenced existing issues and discussions
  • I am filing a BUG report.
  • I have managed to reproduce the bug after upgrading to the latest version
  • I have created an accurate and minimal reproduction

Version

6.0.2

In What environments are you experiencing the problem?

Node.js

Node Version (if applicable)

None

Link To Reproduction

https://codesandbox.io/p/devbox/fabric-node-sandbox-forked-lyrkjc?workspaceId=015bad26-68eb-4698-a728-aa124cb65760

Steps To Reproduce

  1. Just use fabric.FabricImage.fromURL()

See the reproduction, or this image:
image

Expected Behavior

I'd expect to get the "test2" log, which is within the callback.

Actual Behavior

I get "test1" and "test3" logs, but not the "test2" log.

Error Message & Stack Trace

# There is none (that in itself is an issue).

Additional Information

On my actual project I'm running v6.0.2, however that version isn't available on the dropdown when filling out the issue form (I just edited the message to change it from the highest version it would let me, "v6.0.1", to v6.0.2.

@TimChinye
Copy link
Author

Update: I've tested this on v6.0.2, v6.0.1, v6.0.1, and even v6.0.0-beta1. They all didn't work.
v5.3.0, on the other hand, worked like a charm.

@mathieulesniak
Copy link

Callback methods has been removed from v6 as said on breaking changes issue : #8299

You can load image like that :

const img = await fabric.FabricImage.fromURL(url);
console.log(img)

@asturur
Copy link
Member

asturur commented Jul 14, 2024

Please read at least this one before starting working with 6.0,
https://fabricjs.github.io/docs/upgrading/upgrading-to-fabric-60/
and then the first full post of the issue linked. #8299

fabricjs.github.io will be the new fabricjs.com as soon as is in a decent shape

@asturur asturur closed this as completed Jul 14, 2024
@TimChinye
Copy link
Author

TimChinye commented Jul 14, 2024

Callback methods has been removed from v6 as said on breaking changes issue : #8299

You can load image like that :

const img = await fabric.FabricImage.fromURL(url);
console.log(img)

Makes sense, I saw that "upgrading to fabric" changelog and noticed that, but I assumed that if I tried to do it like that it just wouldn't work because none of the docs, tutorials, or demos were like that. I also couldn't find any fabric code out there using promises on github (sourcegraph - guess I'm bad at querying), and I just assumed since the stable v6 came out 2 weeks ago and the v6 beta came out 5 months, that the docs would've been updated by now.

My bad, apologies for the false positive. 👍

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

3 participants