Open blorgon1 opened 2 years ago
Hi @blorgon1, could you provide a reproduction repo? Module resolution is a responsibility of the package manager so it's odd that pnpm
is able to find the package in ls
but not whatever command you have set for building app-a
.
Hi @chris-olszewski, thanks for your response.
Here is a reproduction repo: https://github.com/blorgon1/turbo-symlink-repro
Thanks for the repro! It looks like our globbing library isn't following symlinks. I should be able to get a fix up soon.
@chris-olszewski This was an intentional change introduced in https://github.com/vercel/turbo/pull/1275/commits/494b89423c189781d0d0a5fae5382bfcdd3b300c
We need to make sure that we don't regress #1265.
Ah okay, that's unfortunate given that using a folder for submodules is a common practice.
From the fix commit message:
This caused us to copy their pointed-to contents as if the symlink was a directory, and then when copying the link itself, throw an error because it already existed (as a directory...).
It seems that an alternate solution would be to skip copying symlinks but still traverse them?
Anyways it's easy to work around, thanks for looking into it!
I'm having almost the same issue, but in my case it's caused by the symlink that npm creates to connect workspace dependencies. Do we need to manually copy and workspace dependencies to the output image in our dockerfile? This seems like the kind of default behavior that turbo repo should handle.
This is causing lots of issues for us :( I understand the reason for disabling symlinks but please at least give us an option to enable them again if we have a need to.
@chris-olszewski is this still happening? :)
What version of Turborepo are you using?
1.6.2
What package manager are you using / does the bug impact?
pnpm
What operating system are you using?
Linux
Describe the Bug
When the path to a workspace package contains a symlink, turborepo can't find the package. I am using submodules for some of my workspace packages, and would like to keep all submodules in the same directory, while still linking them into the desired locations.
My repo is set up like this:
With a
pnpm-workspace.yaml
like this:Then when building
app-a
, this error is encountered:Without using the symlink (placing the submodule in the widgets directory), the build passes as expected.
This behaviour differs from pnpm, as pnpm is still able to locate the workspace packages behind a symlink:
Expected Behavior
Packages should be found when they are located behind symlinks. The behaviour should be identical to when the package is in place of the symlink.
To Reproduce
Move a workspace package to a different location (within the same project folder, just not in a workspace package path), and place a symlink to it in the original location.
Reproduction Repo
https://github.com/blorgon1/turbo-symlink-repro