Skip to content

[Bug]: font files are not moved to _assets directory on build #1153

Closed
@ties-v

Description

What version of Remix are you using?

1.1.1

What version of Node are you using? Minimum supported version is 14.

14.18.1

Steps to Reproduce

Example on stackblitz.com

  1. Run yarn create remix to create a new remix project.
  2. Install a fontsource package in this project, e.g: yarn add @fontsource/aguafina-script
  3. Create the main style sheet: (source)
/* app/styles/main.css */
body { font-family: "Aguafina Script"; }
  1. Add the font style sheet and the main style sheet to root.tsx: (source)
// ...
import fontStyleUrl from "@fontsource/aguafina-script/index.css";
import mainStyleUrl from "~/styles/main.css";

export let links: LinksFunction = () => {
  return [
    { rel: "stylesheet", href: fontStyleUrl },
    { rel: "stylesheet", href: mainStyleUrl }
  ]
}
// ...
  1. Run the development server: yarn dev and visit the page in you browser.

Expected Behavior

Font files (*.woff or *.woff2) from the fontsource package are copied to the _assets folder. Also, the compiled version of the fontsource css points to these font files.

Actual Behavior

Font files are not copied to the _assets folder. Browser receives HTTP 404 when trying to load the font.
image

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions