reason-seoul/yarn-plugin-rescript

Error in vercel with mono repository environment

jeong-sik opened this issue · 2 comments

Thanks for the good work!
I encountered a problem.

When the yarn res link script is executed in Vercel, the following error occurs and the process does not proceed.



Internal Error: EISDIR: illegal operation on a directory, unlink '/vercel/path0/node_modules/rescript'
--
06:13:23.466 | Error: EISDIR: illegal operation on a directory, unlink '/vercel/path0/node_modules/rescript'
06:13:23.486 | ➤ YN0001: Error: The `afterInstall` hook failed, see output above.
06:13:23.487 | at afterAllInstalled (/vercel/path0/.yarn/plugins/@yarnpkg/plugin-after-install.cjs:6:1476)
06:13:23.487 | at runMicrotasks (<anonymous>)
06:13:23.487 | at processTicksAndRejections (node:internal/process/task_queues:96:5)
06:13:23.487 | at async Za.triggerHook (/vercel/path0/.yarn/releases/yarn-3.2.1.cjs:397:3367)
06:13:23.487 | at async ze.install (/vercel/path0/.yarn/releases/yarn-3.2.1.cjs:445:4636)
06:13:23.488 | at async /vercel/path0/.yarn/releases/yarn-3.2.1.cjs:502:12383
06:13:23.488 | at async Function.start (/vercel/path0/.yarn/releases/yarn-3.2.1.cjs:414:2373)
06:13:23.488 | at async mm.execute (/vercel/path0/.yarn/releases/yarn-3.2.1.cjs:502:12283)
06:13:23.488 | at async mm.validateAndExecute (/vercel/path0/.yarn/releases/yarn-3.2.1.cjs:350:673)
06:13:23.488 | at async ys.run (/vercel/path0/.yarn/releases/yarn-3.2.1.cjs:364:2087)
06:13:23.489 | ➤ YN0000: Failed with errors in 3m 18s
06:13:23.774 | Error: Command "yarn" exited with 1

The yarn res link script is
I ran it via https://github.com/mhassan1/yarn-plugin-after-install plugin.

afterInstall: yarn res link

I'm not sure if it's okay to discuss this issue here. :)

It seems that there are cases where it raises an exception when calling the unlinkPromise function. Is it necessary to do it with nested try ?

The most simple fix would be replacing that line with await fs.unlinkPromise(dest).catch(() => {}); but I'm more curioused at why the problem is happening 🤔