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

npx react-router reveal crashing #12762

Closed
andokai opened this issue Jan 16, 2025 · 3 comments
Closed

npx react-router reveal crashing #12762

andokai opened this issue Jan 16, 2025 · 3 comments
Labels

Comments

@andokai
Copy link

andokai commented Jan 16, 2025

I'm using React Router as a...

framework

Reproduction

I create a framework based project as normal, the switch to the directory and run reveal

 npx create-react-router@latest test-react-router-app
 cd test
 npx react-router reveal

System Info

System:
    OS: macOS 15.2
    CPU: (10) arm64 Apple M1 Max
    Memory: 139.50 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.13.0 - ~/.local/state/fnm_multishells/75929_1736928857119/bin/node
    npm: 10.9.2 - ~/.local/state/fnm_multishells/75929_1736928857119/bin/npm
    pnpm: 9.14.2 - ~/Library/pnpm/pnpm
    Watchman: 2024.12.02.00 - /opt/homebrew/bin/watchman
  Browsers:
    Chrome: 131.0.6778.265
    Safari: 18.2
    Safari Technology Preview: 18.2
  npmPackages:
    @react-router/dev: ^7.1.2 => 7.1.2 
    @react-router/node: ^7.1.2 => 7.1.2 
    @react-router/serve: ^7.1.2 => 7.1.2 
    react-router: ^7.1.2 => 7.1.2 
    vite: ^5.4.11 => 5.4.11

Used Package Manager

npm

Expected Behavior

I'd expect the command to show the entry point files.

Actual Behavior

It crashes out with the following

The following error is a bug in React Router; please open an issue! https://github.com/remix-run/react-router/issues/new/choose
Error: getVite() called before preloadVite()
    at invariant (/Users/andrew/Developer/temp/test-react-router-app/node_modules/@react-router/dev/dist/cli/index.js:49:11)
    at getVite (/Users/andrew/Developer/temp/test-react-router-app/node_modules/@react-router/dev/dist/cli/index.js:81:3)
    at resolveViteConfig (/Users/andrew/Developer/temp/test-react-router-app/node_modules/@react-router/dev/dist/cli/index.js:888:15)
    at loadPluginContext (/Users/andrew/Developer/temp/test-react-router-app/node_modules/@react-router/dev/dist/cli/index.js:925:26)
    at generateEntry (/Users/andrew/Developer/temp/test-react-router-app/node_modules/@react-router/dev/dist/cli/index.js:1478:19)
    at run2 (/Users/andrew/Developer/temp/test-react-router-app/node_modules/@react-router/dev/dist/cli/index.js:1723:13)
    at Object.<anonymous> (/Users/andrew/Developer/temp/test-react-router-app/node_modules/@react-router/dev/dist/cli/index.js:1738:1)
    at Module._compile (node:internal/modules/cjs/loader:1562:14)
    at Object..js (node:internal/modules/cjs/loader:1699:10)
    at Module.load (node:internal/modules/cjs/loader:1313:32)

So I'm reporting it like it has asked me to. 🙂

@andokai andokai added the bug label Jan 16, 2025
@nick-cheatwood7
Copy link

Can confirm that downgrading the following packages from ^7.1.2 to 7.1.1 fixed this bug:

// package.json
{
 "dependencies": {
-    "@react-router/node": "^7.1.2",
+    "@react-router/node": "7.1.1",
-    "@react-router/serve": "^7.1.2",
+    "@react-router/serve": "7.1.1",
-    "react-router": "^7.1.2"
+    "react-router": "7.1.1"
  },
  "devDependencies": {
-    "@react-router/dev": "^7.1.2"
+    "@react-router/dev": "7.1.1"
  }
}

@markdalgleish
Copy link
Member

This is fixed by #12745 which will be out in the next release.

In the meantime, you can use npx @react-router/dev@nightly reveal.

@markdalgleish
Copy link
Member

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

No branches or pull requests

3 participants