SwapWidget font CSS not included in build
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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