Skip to content

prerender does not work with recommended vercel template #12720

Closed
@lifeiscontent

Description

@lifeiscontent

I'm using React Router as a...

framework

Reproduction

Minimal reproduction: https://codesandbox.io/p/devbox/64pkht?file=%2Fvite.config.ts%3A28%2C1

  1. kill server
  2. run pnpm build see it fail

see it work:

  1. comment out these lines:
    build: {
      assetsInlineLimit: 0,
      sourcemap: "hidden",
      rollupOptions: isSsrBuild
        ? {
            input: "./server/app.ts",
          }
        : undefined,
    },

  1. run pnpm build

System Info

System:
    OS: Linux 6.1 Debian GNU/Linux 12 (bookworm) 12 (bookworm)
    CPU: (2) x64 AMD EPYC
    Memory: 1.70 GB / 4.01 GB
    Container: Yes
    Shell: Unknown
  Binaries:
    Node: 20.12.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.5.0 - /usr/local/bin/npm
    pnpm: 8.15.6 - /usr/local/share/npm-global/bin/pnpm
  npmPackages:
    @react-router/dev: ^7.1.1 => 7.1.1 
    @react-router/express: 7.1.1 => 7.1.1 
    @react-router/node: ^7.1.1 => 7.1.1 
    @react-router/serve: ^7.1.1 => 7.1.1 
    react-router: ^7.1.1 => 7.1.1 
    vite: ^5.4.11 => 5.4.11

Used Package Manager

npm

Expected Behavior

able to build with prerender

Actual Behavior

due to customization of the build in Vite, build fails.

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