D
Deno

help

error: Uncaught Error: Input watch path is neither a file nor a directory.

JRJoshua | Rem-Chan10/28/2023
Im encountering a weird error when I run a code in Windows that was initially created in a OSX. It still runs fine in OSX, but in windows its shows the following error (synced through github):
error: Uncaught Error: Input watch path is neither a file nor a directory.
at new FsWatcher (ext:runtime/40_fs_events.js:17:21)
at Object.watchFs (ext:runtime/40_fs_events.js:60:10)
at ext:deno_node/_fs/_fs_watch.ts:58:21
at Object.action (ext:deno_web/02_timers.js:151:11)
at handleTimerMacrotask (ext:deno_web/02_timers.js:65:10)
at eventLoopTick (ext:core/01_core.js:189:21)
error: Uncaught Error: Input watch path is neither a file nor a directory.
at new FsWatcher (ext:runtime/40_fs_events.js:17:21)
at Object.watchFs (ext:runtime/40_fs_events.js:60:10)
at ext:deno_node/_fs/_fs_watch.ts:58:21
at Object.action (ext:deno_web/02_timers.js:151:11)
at handleTimerMacrotask (ext:deno_web/02_timers.js:65:10)
at eventLoopTick (ext:core/01_core.js:189:21)
I'm not able to diagonise the error, google has nothing about it and I dont use the watch functionality. The run command was:
deno run --allow-read --allow-env --allow-net --allow-sys index.ts
deno run --allow-read --allow-env --allow-net --allow-sys index.ts
DAHDeno AI Helper10/28/2023
The error message you're seeing is related to the Deno.watchFs function. According to the documentation, this function is used to watch for file system events against one or more paths, which can be files or directories. The error message "Input watch path is neither a file nor a directory" suggests that the path you're trying to watch does not exist or is not recognized as a file or directory. The issue might be due to differences in how file paths are handled in different operating systems. For example, Windows uses backslashes (\) in file paths, while macOS and Linux use forward slashes (/). If your code includes file paths, you might need to adjust them to be compatible with Windows. If you're not explicitly using Deno.watchFs in your code, it might be used by a library or module that your code depends on. You could try to identify where Deno.watchFs is used and what paths it's watching. If you're unable to find the source of the issue, you could try to debug the problem by adding console.log statements before the Deno.watchFs calls to print out the paths that are being watched. This might help you identify any paths that could be causing the issue. Remember that Deno.watchFs requires allow-read permission, which you have already included in your run command. Please note that this advice is general in nature and not explicitly stated in the documentation.
LLeokuma10/28/2023
Maybe one of your dependencies (an npm dependency I'm guessing) is trying to watch a file or directory that you have in OSX but you don't have in Windows. Also maybe when you added that dependency it detected that the OS was OSX and configured itself to run in it and now it can't run in Windows?
MⴷMOUR10/28/2023
@Joshua | Rem-Chan ^^
ABAltair 680b10/28/2023
Or a hard coded slash issue '/' vs '\'.
JRJoshua | Rem-Chan10/28/2023
but the node_modules aren't transferred while sharing the code right? So when its run on the windows, it shouldnt affect it The program doesnt even go to the first line, and thats weird. Like we added console.log on top of everything to see if its executed but nope. The run goes straight to the error. the npm packages we use are:
{
"@discordeno/bot": "^19.0.0-next.8d1ba2a",
"@spectacles/brokers": "^0.9.3",
"dotenv": "^16.3.1",
"express": "^4.18.2",
"ioredis": "^5.3.2",
"winston": "^3.9.0"
}
{
"@discordeno/bot": "^19.0.0-next.8d1ba2a",
"@spectacles/brokers": "^0.9.3",
"dotenv": "^16.3.1",
"express": "^4.18.2",
"ioredis": "^5.3.2",
"winston": "^3.9.0"
}
Mmarvinh.10/28/2023
Please file a bug for that. It sounds like something the team should be aware of and can resolve in CLI so that other user's don't run into this
JRJoshua | Rem-Chan10/29/2023
Looks like its the npm i18n package doing its work. It has a fs.watch in it, and thats the trigger I believe. I dont exactly know why it should but yeah. Removing it fixed the issue. It works fine in mac but not in windows

Looking for more? Join the community!

Recommended Posts
ES Module mocking workaroundHello all, I've been using Deno and Fresh for the past few weeks on a personal project and I love itFontAwesome Import into island component not working as expectedHey, I want to use FontAwesome with a Fresh component inside my island folder. I followed the follKV - Not possible to maintain in real world?I have a question regarding Deno **KV**: I just checked the docs and it seems straight forward so faGet a Parameter Value in Oakso if I set up a router like this ```router.get("/:id", (ctx) => {/*handle router context*/})```thenreadTextFile() not working?what is this? its there but its not workingkv store key granualityHow cheap are the `kv.get` operations? Say I have a userprofile with 3 fields, should I create 3 kedeno tap metadataHello. I am running deno tests with `deno test --reporter=tap`. I would like to add additional fieldUsing ESBuild with DenoHey, is anyone more familiar with ESBuild? I am currently trying to transpile my Deno TypeScript proMultiple subdomainsHow can I listen for incoming http request on multiple subdomains?Can't upgrade request to websocketI want to use a websocket in one of my middlewares. But I keep getting an error saying I can't upgrAccess `navigator.geolocation` in deno runtimeHello, is it possible to access `navigator.geolocation` in the deno runtime?Tracking Down Lost MemoryHi, I have a long running service that creates many `JsRuntime`s over time and I have found that I `deno run` ignores @deno-types?```ts Uncaught SyntaxError: The requested module 'pg' does not provide an export named 'Pool' importWhere is my Twitter access token with Deno KV Oauth?I signed in successfully and now the Deno KV database is just storing `true`. It's not enough to intHow do I import the stripe SDK into my fresh.js projectHi there! How do I import the stripe SDK into my fresh.js project? Im struggling with my deno.json fUnable to find NPM:Rollup 4.1.4 on M1 MacHi all, hooking up a new build process for UI project, trying to use Rollup on an M1 Mac. My build How to get custom folder structure with Fresh?Hello, I want to integrate Fresh into my existing project. I want to use the 4 directories: componenFresh error: Could not fetch latest versionTotal newbie here. I'm getting "Update check failed: Could not fetch latest version." when I make a VSCode Test Debugging```json { "name": "Test", "request": "launch", "type": "node", "cwd": "$Can you recommend a mysql driver for deno that isn't a complete dead end?mysql2 port: never updated. mysql driver: doesn't support strings mysql connector from Oracle: no on