sparklemotion / mechanize

Mechanize is a ruby library that makes automated web interaction easy.
https://www.rubydoc.info/gems/mechanize/
MIT License
4.39k stars 473 forks source link

Vite Dev server crachses due to a circular reference in a symlink #619

Closed kolchurinvv closed 1 year ago

kolchurinvv commented 1 year ago

package.json script that is being run via npm is vite dev --host, which produces this result:

Waiting for the debugger to disconnect...
node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

Error: ELOOP: too many symbolic links encountered, stat '/opt/homebrew/Library/Homebrew/vendor/gems/mechanize-2.9.1/mechanize-2.9.1'
Emitted 'error' event on FSWatcher instance at:
    at FSWatcher._handleError (file:///Users/vladimir/Dev_Projects/lime812/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:52169:10)
    at FsEventsHandler._handleFsEventsSymlink (file:///Users/vladimir/Dev_Projects/lime812/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:51395:18) {
  errno: -62,
  code: 'ELOOP',
  syscall: 'stat',
  path: '/opt/homebrew/Library/Homebrew/vendor/gems/mechanize-2.9.1/mechanize-2.9.1'
}

Node.js v18.16.1
error: script "dev" exited with code 1 (SIGHUP)

while a simple rm /opt/homebrew/Library/Homebrew/vendor/gems/mechanize-2.9.1/mechanize-2.9.1 does the trick, this symlink is always created on any brew intsall / brew update command. the output of ls -la (lsa is the alias for it) is:

homebrew/Library/Homebrew/vendor/gems/mechanize-2.9.1 on  stable [$]                                        12:01:15
➜ lsa
total 8
drwxr-xr-x  5 vladimir  admin   160B Jul  4 11:59 .
drwxr-xr-x  4 vladimir  admin   128B May  4 20:53 ..
-rw-r--r--  1 vladimir  admin   1.2K May  4 20:53 LICENSE.txt
drwxr-xr-x  3 vladimir  admin    96B May  4 20:53 lib
lrwxr-xr-x  1 vladimir  admin    16B Jul  4 11:59 mechanize-2.9.1 -> mechanize-2.9.1/

any advice would be appreciated.