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

Allow mjs extension for route config file #12869

Open
sdavids opened this issue Jan 27, 2025 · 0 comments
Open

Allow mjs extension for route config file #12869

sdavids opened this issue Jan 27, 2025 · 0 comments
Labels

Comments

@sdavids
Copy link

sdavids commented Jan 27, 2025

I'm using React Router as a...

framework

Reproduction

const entryExts = [".js", ".jsx", ".ts", ".tsx"];

System Info

System:
    OS: macOS 12.7.6
    CPU: (8) x64 Intel(R) Core(TM) i7-6920HQ CPU @ 2.90GHz
    Memory: 569.35 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 22.13.1 - ~/.local/run/fnm_multishells/1019_1737974614999/bin/node
    npm: 10.9.2 - ~/.local/run/fnm_multishells/1019_1737974614999/bin/npm
  Browsers:
    Brave Browser: 131.1.73.104
    Chrome: 131.0.6778.267
    Safari: 17.6
  npmPackages:
    @react-router/dev: 7.1.3 => 7.1.3 
    @react-router/node: 7.1.3 => 7.1.3 
    @react-router/serve: 7.1.3 => 7.1.3 
    react-router: 7.1.3 => 7.1.3 
    vite: 6.0.11 => 6.0.11

Used Package Manager

npm

Expected Behavior

app/routes.mjs is allowed.

Actual Behavior

$ ls app/routes.*
app/routes.mjs
$ node --run dev
Error: Route config file not found at "app/routes.ts".
    at createConfigLoader (/tmp/test/node_modules/@react-router/dev/dist/vite.js:486:11)
    at createContext2 (/tmp/test/node_modules/@react-router/dev/dist/vite.js:775:24)
    at watch (/tmp/test/node_modules/@react-router/dev/dist/vite.js:750:15)
@sdavids sdavids added the bug label Jan 27, 2025
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

1 participant