Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vite dependency optimization is causing errors in development #9798

Open
tavoyne opened this issue Jul 28, 2024 · 1 comment
Open

Vite dependency optimization is causing errors in development #9798

tavoyne opened this issue Jul 28, 2024 · 1 comment

Comments

@tavoyne
Copy link

tavoyne commented Jul 28, 2024

Reproduction

See #8876 and #8917.

// vite.config.ts

import {
  vitePlugin as remix,
  cloudflareDevProxyVitePlugin as remixCloudflareDevProxy,
} from "@remix-run/dev";
import { defineConfig } from "vite";
import tsconfigPaths from "vite-tsconfig-paths";

import { getLoadContext } from "./loadContext";

export default defineConfig({
  plugins: [
    remixCloudflareDevProxy({ getLoadContext }),
    remix(),
    tsconfigPaths(),
  ],
});

System Info

System:
  OS: macOS 14.1
  CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
  Memory: 1.79 GB / 32.00 GB
  Shell: 5.9 - /bin/zsh
Binaries:
  Node: 20.9.0 - ~/.nvm/versions/node/v20.9.0/bin/node
  npm: 10.1.0 - ~/.nvm/versions/node/v20.9.0/bin/npm
Browsers:
  Chrome: 126.0.6478.183
  Chrome Canary: 129.0.6622.0
  Safari: 17.1
npmPackages:
  @remix-run/cloudflare: ^2.10.3 => 2.10.3 
  @remix-run/cloudflare-pages: ^2.10.3 => 2.10.3 
  @remix-run/dev: ^2.10.3 => 2.10.3 
  @remix-run/eslint-config: ^2.10.3 => 2.10.3 
  @remix-run/react: ^2.10.3 => 2.10.3 
  vite: ^5.3.5 => 5.3.5

Used Package Manager

npm

Expected Behavior

Pages load smoothly.

Actual Behavior

Errors like the following on page loads:

image

@andrecasal
Copy link

Yep, all pages visited for the first time fail to load because Vite optimizes the dependencies, but sends a 504 Outdated Dependency to the browser.

Only happens in during dev and doesn't affect production, but having all tests (or page loads) fail on first try is a bad experience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants