remix
remix copied to clipboard
Error loops when clientLoader crashes after setting environment variables in root.tsx
Reproduction
- Access https://stackblitz.com/edit/remix-run-remix-t17vmh?file=README.md
- Open Preview in new tab
- 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.
System Info
$ npx envinfo --system --npmPackages '{vite,@remix-run/*}' --binaries --browsers
Need to install the following packages:
[email protected]
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.
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