-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Closed
Description
Reproduction
- Create an
.mjsfile with some js - Import like you normally would import something, like
import MyModule from "./my-module"; - See it throws an error. "Cannot find module"
https://stackblitz.com/edit/github-nv3shlgq
System Info
System:
OS: Windows 11 10.0.22621
CPU: (4) x64 AMD EPYC 7763 64-Core Processor
Memory: 16.74 GB / 21.95 GB
Binaries:
Node: 22.16.0 - C:\Program Files\nodejs\node.EXE
npm: 11.5.1 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: Chromium (139.0.3405.86)
npmPackages:
@react-router/dev: 7.7.1
@react-router/fs-routes: 7.7.1
@react-router/node: 7.7.1
@react-router/serve: 7.7.1
lucide-react: 0.544.0
react-router: 7.7.1
react-router-devtools: 5.0.6
vite: 6.3.5Used Package Manager
npm
Expected Behavior
Remix should import .mjs files if it won't find a .js file.
Actual Behavior
Throws error: "Cannot find module"