Skip to content

Allow mjs extension for route config file #12869

Open
@sdavids

Description

@sdavids

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)

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @sdavids@brophdawg11

        Issue actions

          Allow mjs extension for route config file · Issue #12869 · remix-run/react-router