Hello! I have a monorepo setup and I stumbled upon this issue when migrating my custom server.ts to the plugin.
failed to load config from /Users/arodriguez/Code/coolfire/apps/web/vite.config.ts
error when starting dev server:
file:///Users/arodriguez/Code/coolfire/node_modules/remix-express-dev-server/dist/index.js:1
import { minimatch } from 'minimatch';
^^^^^^^^^
SyntaxError: Named export 'minimatch' not found. The requested module 'minimatch' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
import pkg from 'minimatch';
const { minimatch } = pkg;
at ModuleJob._instantiate (node:internal/modules/esm/module_job:132:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:214:5)
at async ModuleLoader.import (node:internal/modules/esm/loader:329:24)
at async loadConfigFromBundledFile (file:///Users/arodriguez/Code/coolfire/node_modules/vite/dist/node/chunks/dep-cNe07EU9.js:68705:21)
at async loadConfigFromFile (file:///Users/arodriguez/Code/coolfire/node_modules/vite/dist/node/chunks/dep-cNe07EU9.js:68558:28)
at async resolveConfig (file:///Users/arodriguez/Code/coolfire/node_modules/vite/dist/node/chunks/dep-cNe07EU9.js:68161:28)
at async _createServer (file:///Users/arodriguez/Code/coolfire/node_modules/vite/dist/node/chunks/dep-cNe07EU9.js:64686:20)
at async CAC.<anonymous> (file:///Users/arodriguez/Code/coolfire/node_modules/vite/dist/node/cli.js:762:24)
I have double checked my setup to follow what the example app does, but unfortunately I kept running into the same issue. I fixed the issue manually with a patch:
-import { minimatch } from 'minimatch';
+import pkg from 'minimatch';
+const { minimatch } = pkg;
Hello! I have a monorepo setup and I stumbled upon this issue when migrating my custom server.ts to the plugin.
I have double checked my setup to follow what the example app does, but unfortunately I kept running into the same issue. I fixed the issue manually with a patch: