Uniswap / Uniswap/interface

SwapWidget font CSS not included in build

Open
#3,343 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
5.5k
Forks
5.4k
PR merge metrics
No merged PRs in 30d

Description

When a React application with SwapWidget is built locally (and/or deployed on IPFS, example here), some fonts cannot be fetched as they are not included in the build.

It plays well when it's deployed to Vercel as it only throws warnings like these:

Failed to decode downloaded font: https://uni-widget-iframe.vercel.app/~@fontsource/inter/files/inter-latin-variable-wghtOnly-normal.woff2

...but the app bootstraps successfully.

However, when I build it locally and upload to IPFS, the mentioned warning becomes an error because the resource cannot be found and results with the error:

Refused to apply style from 'https://bafybeigj6vftgedsms27yfe3ebzhanqnhgrwxic5hug4457mysbka6w5iy.ipfs.dweb.link/~@fontsource/ibm-plex-mono/400.css' because its MIME type ('text/plain') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

@zzmp, I've seen the previous attempt, but I still have this problem.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the SwapWidget build path and previous pull request #3331, then reproduce a local build and IPFS deployment to inspect how font assets are referenced. Done means the built application includes or correctly serves the fonts without missing-resource or stylesheet MIME errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
build-system, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.