Skip to content

Fix Safari web worker - #2165

Merged
justvanrossum merged 3 commits into
mainfrom
fix-safari-web-worker-issue2156
Oct 18, 2025
Merged

Fix Safari web worker#2165
justvanrossum merged 3 commits into
mainfrom
fix-safari-web-worker-issue2156

Conversation

@justvanrossum

Copy link
Copy Markdown
Member

Attempting to fix #2156.

It is still not working:

  • in Safari, go to a fontra glyph editor
  • go to the reference font panel
  • drop any ttf onto the font list

I get this in the console:

[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (fontra-core.e894e05f.js, line 0)
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (fontra-core.e894e05f.js, line 0)
[Log] error from web worker: – ErrorEvent {isTrusted: true, message: "NetworkError: Load failed", filename: "http://localhost:8000/js/opfs-write-worker.chunk.js", …}
ErrorEvent {isTrusted: true, message: "NetworkError: Load failed", filename: "http://localhost:8000/js/opfs-write-worker.chunk.js", lineno: 263, colno: 28, …}ErrorEvent
[Error] NetworkError: Load failed (opfs-write-worker.chunk.js, line 263)
[Error] Unhandled Promise Rejection: NetworkError: Load failed

As a screen grab:
image

The file http://localhost:8000/js/opfs-write-worker.chunk.js aka. src/fontra/client/js/opfs-write-worker.chunk.js exists.
However, it tries to load http://localhost:8000/js/js/fontra-core.e894e05f.js which does not: it has one js/ too many in the URL. It almost sounds like a webpack bug.

The code in src/fontra/client/js/opfs-write-worker.chunk.js is quite incomprehensible (it's internal webpack helper code), and I can't see why it uses the wrong URL to load the chunk.

@simoncozens, any help would be greatly appreciated.

@justvanrossum
justvanrossum force-pushed the fix-safari-web-worker-issue2156 branch from a6b1708 to 01f3a20 Compare October 18, 2025 15:19
@justvanrossum

Copy link
Copy Markdown
Member Author

I found a fix that seems to work: the addional "js/" was added in webpack.config.cjs. Fingers crossed it doesn't have negative side effects.

@justvanrossum
justvanrossum merged commit 13f5bf1 into main Oct 18, 2025
4 checks passed
@justvanrossum
justvanrossum deleted the fix-safari-web-worker-issue2156 branch October 18, 2025 15:34
@justvanrossum justvanrossum changed the title Attempt to fix Safari web worker Fix Safari web worker Oct 18, 2025
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 this pull request may close these issues.

Reference Font no longer works in Safari, since js-split

1 participant