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

Error loops when clientLoader crashes after setting environment variables in root.tsx #9423

Open
mkizka opened this issue May 12, 2024 · 1 comment

Comments

@mkizka
Copy link

mkizka commented May 12, 2024

Reproduction

  1. Access https://stackblitz.com/edit/remix-run-remix-t17vmh?file=README.md
  2. Open Preview in new tab
  3. Open Chrome DevTools

The only files edited are app/route/_index.tsx and app/root.tsx. I followed https://remix.run/docs/en/main/guides/envvars to set the environment variables.

image

System Info

$ npx envinfo --system --npmPackages '{vite,@remix-run/*}' --binaries --browsers
Need to install the following packages:
envinfo@7.13.0
Ok to proceed? (y) y

  System:
    OS: Linux 5.15 Ubuntu 22.04.3 LTS 22.04.3 LTS (Jammy Jellyfish)
    CPU: (12) x64 12th Gen Intel(R) Core(TM) i5-12400
    Memory: 13.46 GB / 15.62 GB
    Container: Yes
    Shell: 3.7.0 - /usr/bin/fish
  Binaries:
    Node: 20.13.0 - ~/.local/share/mise/installs/node/lts/bin/node
    npm: 10.5.2 - ~/.local/share/mise/installs/node/lts/bin/npm
    pnpm: 8.15.7 - ~/.local/share/mise/installs/node/lts/bin/pnpm
  Browsers:
    Chrome: 121.0.6167.85
  npmPackages:
    @remix-run/dev: ^2.9.2 => 2.9.2 
    @remix-run/node: ^2.9.2 => 2.9.2 
    @remix-run/react: ^2.9.2 => 2.9.2 
    @remix-run/serve: ^2.9.2 => 2.9.2 
    vite: ^5.1.0 => 5.2.11

Used Package Manager

pnpm

Expected Behavior

Error does not loop, and is displayed on the screen.

Actual Behavior

Error loops and nothing is displayed on the screen.

@mkizka
Copy link
Author

mkizka commented May 12, 2024

I found a workaround. Regarding the environment variables, you can revert to root.tsx and use the VITE_ prefix and import.meta.env.
https://vitejs.dev/guide/env-and-mode.html

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

2 participants