Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERR_FEATURE_UNAVAILABLE_ON_PLATFORM #12

Closed
dPacc opened this issue Feb 24, 2023 · 8 comments · Fixed by #15
Closed

ERR_FEATURE_UNAVAILABLE_ON_PLATFORM #12

dPacc opened this issue Feb 24, 2023 · 8 comments · Fixed by #15

Comments

@dPacc
Copy link

dPacc commented Feb 24, 2023

Hi @Debdut , the latest commit is throwing this error when we run npm run start BROWSER command. It was running during the previous vite build.

TypeError [ERR_FEATURE_UNAVAILABLE_ON_PLATFORM]: The feature watch recursively is unavailable on the current platform, which is being used to run Node.js

I have tried switching the Node.js versions to v16.17.0, v18.13.0. But it still doesn't work. Any idea on how to fix this?

Here is what I found on StackOverflow: https://stackoverflow.com/questions/61806341/how-to-fix-the-feature-watch-recursively-is-unavailable-on-the-current-platform

@Debdut
Copy link
Owner

Debdut commented Feb 28, 2023

are you on linux? run uname -a and post the result here

@dPacc
Copy link
Author

dPacc commented Mar 1, 2023

This is the output

Linux omen 5.15.0-60-generic #66~20.04.1-Ubuntu SMP Wed Jan 25 09:41:30 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

@icheered
Copy link

Any updates on this topic? I'm having the same issue

@Debdut
Copy link
Owner

Debdut commented Mar 11, 2023

@nascarsayan can you test this on a linux VM?

@nascarsayan
Copy link
Collaborator

nascarsayan commented Mar 12, 2023

I looked into the issue.
The issue is coming in Ubuntu with Linux Kernel version 5.15.0-60-generic with both nodejs v16.18.1 and v18.13.0. I performed ubuntu upgrade from 20 to 22, which upgraded Linux version to 5.15.15-051515-generic, but still seeing the same issue.
I had earlier tested out browser-extension in pop-os v20.04 where the linux kernel version was 5.15.15-76051515-generic, where it was working fine.

fs.watch recursive was not supported in Linux.
I think this might be a limitation of fs.watch, and the same is mentioned in the nodejs docs here. The limitation is mentioned both in nodejs v16 and v18. However, in this PR they have added the support for recursive file watch in Linux.

This stackoverflow article recommends using chokider instead of fs.watch for better cross-platform support, including recursive watch.
@Debdut, We might need to use chokider here as a dev-dependency instead of fs.watch (and add another external npm dependency, phew!) to support all Linux versions.

@icheered
Copy link

@nascarsayan thanks for looking into it. I also tried using chokidar and it is practically a drop-in replacement (fs.watch -> chokidar.watch) however there is an issue with the block of code that watches the public files folder. I'm currently on my phone so I can't give more info, but I couldn't get that to work within a few minutes.

@Debdut
Copy link
Owner

Debdut commented Mar 12, 2023

@nascarsayan another dependency, phew 😮‍💨

@icheered let me know

@nascarsayan nascarsayan linked a pull request Mar 18, 2023 that will close this issue
@nascarsayan
Copy link
Collaborator

node-watch is working on Linux.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants