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

loadFromUrl does not support Node.js environment #506

Closed
antoineol opened this issue Feb 27, 2022 · 2 comments · Fixed by #503
Closed

loadFromUrl does not support Node.js environment #506

antoineol opened this issue Feb 27, 2022 · 2 comments · Fixed by #503

Comments

@antoineol
Copy link
Contributor

Here is a PR to solve it: #503 . Please let me know if anything is wrong about it :)

loadFromUrl implementation relies on XHR2, which is only available in the browser. I tried a polyfill, but the available XHR2 polyfill seems to have a bug causing the process to hand for ~120 seconds in some cases.

The PR provides a nodejs implementation to load from a URL.

Expected Behavior

loadFromUrl works in nodejs.

Current Behavior

It fails by default on nodejs (no XHR) and I couldn't find a polyfill working as expected.

Possible Solution

C.f. PR #503

Steps to Reproduce (for bugs)

  1. On nodejs, load a font from a URL instead of file system.
  2. It fails.

Context

C.f. PR for motivations and context.

Your Environment

@ILOVEPIE
Copy link
Contributor

ILOVEPIE commented Feb 3, 2023

@Connum we should probably merge this at some point to get the library working with node versions lower than 18.

@Connum
Copy link
Contributor

Connum commented Feb 4, 2023

I just added a PR on the fork to test this. When @antoineol merges it, @ILOVEPIE can do the review

@Connum Connum linked a pull request Feb 4, 2023 that will close this issue
8 tasks
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

Successfully merging a pull request may close this issue.

3 participants