Skip to content

build/server/assets is empty on production build #13540

Closed
@yashok111

Description

@yashok111

I'm using React Router as a...

framework

Reproduction

The Default React Router template can be used for reproduction. Just create a new project with
npx create-react-router@latest --template remix-run/react-router-templates/default. Then run build script. In console you will see build logs like on screenshot that assumes that static assets were emitted to assets folder.

Image

But when you try to list files inside assets folder it actually empty. This issue leads to incorrect server side rendered layout.

Image

On last screenshot you can see actual server rendered html. No css styles and svg's

Image

System Info

System:
    OS: macOS 15.4.1
    CPU: (12) arm64 Apple M4 Pro
    Memory: 230.88 MB / 24.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.14.0 - ~/.nvm/versions/node/v22.14.0/bin/node
    Yarn: 1.22.22 - ~/.yarn/bin/yarn
    npm: 10.9.2 - ~/.nvm/versions/node/v22.14.0/bin/npm
  Browsers:
    Chrome: 136.0.7103.49
    Safari: 18.4
  npmPackages:
    @react-router/dev: ^7.5.3 => 7.5.3
    @react-router/node: ^7.5.3 => 7.5.3
    @react-router/serve: ^7.5.3 => 7.5.3
    react-router: ^7.5.3 => 7.5.3
    vite: ^6.3.3 => 6.3.5

Used Package Manager

yarn

Expected Behavior

Server Side rendered output can access static assets generated by production build

Actual Behavior

Server build static assets is missing

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions