Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F3066770
repro_vite_watcher_add_bug.mjs
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
844 B
Referenced Files
None
Subscribers
None
repro_vite_watcher_add_bug.mjs
View Options
// Repro: Vite's chokidar watcher path triggers
// `TypeError: undefined is not a function` without needing full server startup.
//
// Run with:
// ant tests/repro_vite_watcher_add_bug.mjs
import * as vite from '/Users/themackabu/.ant/pkg/exec/vite/node_modules/vite/dist/node/index.js';
process.on('unhandledRejection', (reason) => {
console.log('[unhandledRejection]', reason?.name, reason?.message);
if (reason?.stack) console.log(reason.stack);
});
const server = await vite.createServer({
configFile: false,
root: process.cwd(),
optimizeDeps: { noDiscovery: true, entries: [] },
});
server.watcher.add([
'.env.local',
'.env.development',
'.env.development.local',
'.definitely-missing',
]);
console.log('watcher.add issued');
setTimeout(async () => {
console.log('done wait');
await server.close();
}, 1500);
File Metadata
Details
Attached
Mime Type
application/javascript
Expires
Fri, Apr 3, 10:07 PM (1 d, 20 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
521517
Default Alt Text
repro_vite_watcher_add_bug.mjs (844 B)
Attached To
Mode
rANT Ant
Attached
Detach File
Event Timeline
Log In to Comment