Skip to content

inlineStyleThreshold causes relative link to fonts/resources to be broken #6720

@audacioustux

Description

@audacioustux

Describe the bug

it works fine in dev mode, but with inlineStyleThreshold: 32 * 1024 and vite.build.assetsInlineLimit: 2 * 1024, the relative links to font files (e.g. .woff2) gets broken, as the css is now resides in html, and the font file in .svelte-kit/output/..
and i can't change the url to absolute url either, as I faced the issue with @fontsource/* fonts.

Reproduction

use any relative url in css, and make sure inlineStyleThreshold causes the css to be inlined

Logs

Error: Not found: /playfair-display-latin-variable-wghtOnly-normal-22b6cdc4.woff2

System Info

System:
    OS: macOS 11.6.5
    CPU: (4) x64 Intel(R) Core(TM) i5-4690 CPU @ 3.50GHz
    Memory: 89.70 MB / 24.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.17.0 - ~/.asdf/installs/nodejs/16.17.0/bin/node
    Yarn: 1.22.11 - /usr/local/bin/yarn
    npm: 8.15.0 - ~/.asdf/plugins/nodejs/shims/npm
  Browsers:
    Chrome: 105.0.5195.102
    Chrome Canary: 107.0.5292.0
    Firefox Nightly: 106.0a1
    Safari: 15.4

Severity

serious, but I can work around it

Additional Information

i had to disable inlineStyleThreshold, and call it a workaround

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions