-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Symlink issue involving bun link
#10223
Comments
#10218 may be related |
|
Is it related? I don't even understand what that issue is trying to explain. Also this is a Linux environment |
Oops, I mistakenly thought this was an issue related to junctions on windows, and completely missed that this is a linux environment 🤦 . Would it be possible for you to provide a link to the repository where you encountered this issue? |
There is no specific repository that causes the issue in particular. As described, it seems to be related to the handling of symbolic links. Otherwise, if you really want to clone my repositories, do this (on rocky linux 9.3): mkdir test && cd test
git clone git@github.com:Coachonko/coachonko.com.git
git clone git@github.com:Coachonko/wareme.git
# remove the dependency from coachonko.com in order to reproduce the issue
sed -i '/"@wareme\/translations": "3.7.2",/d' coachonko.com/package.json
# build the packages
cd wareme/packages/event-emitter && bun run build && cd ../translations && bun run build && cd ../../..
# edit package.json('s) to match npm
# P.S. please either make bun compatible with npm scoped package.json or support git monorepos using bun package.json syntax
sed -i 's/"@wareme\/event-emitter": "workspace:..\/event-emitter"/"@wareme\/event-emitter": "\^3.1.0"/' wareme/packages/translations/package.json
sed -i 's/"name": "translations",/"name": "@wareme\/translations",/g' wareme/packages/translations/package.json
sed -i 's/"name": "event-emitter",/"name": "@wareme\/event-emitter",/g' wareme/packages/event-emitter/package.json
# install dependencies, link package, verify it is a symbolic link
cd coachonko.com && bun install && cd ../wareme/event-emitter && bun link && cd ../wareme/translations && bun link && cd ../../coachonko.com && bun link @wareme/translations && ls -lah node_modules/@wareme/
# create .env and run the project
echo "PORT=8080" > .env && bun run dev:server & bun run dev:browser # or run each in a different terminal instance
# observe how the project fails to run: no errors happen but localhost:8080 serves blank
# kill Bun, remove symbolic link and hard-copy files instead
rm -f node_modules/@wareme/translations
cp -ra ../wareme/packages/* node_modules/@wareme/
# run project again
bun run dev:server & bun run dev:browser
# observe how everything works correctly now: pages are not blank. |
Can you provide a more minimal reproduction? |
bun link
bun link
I'm not sure how, since the repro requires some manual symbolic linking to be done, or at least some manual operations. |
This bug is making developing with bun almost impossible, it forces me to cope/paste directories at every change. I have provided extensive information and documented step-by-step reproduction, you have not provided any further information on how you'd like to have a 'more minimal' reproduction. |
What version of Bun is running?
1.1.3+2615dc742
What platform is your computer?
Linux 5.14.0-362.24.1.el9_3.x86_64 x86_64 x86_64
What steps can reproduce the bug?
The arrow shows the file is a symbolic link
4. Remove the symbolic link and manually copy files
Now everything works.
This confirms Bun has issues with symbolic links.
I have done further, that cannot be as easily replicated, by symbolic-linking the dependency inside the current project
src
directory, and the result was the exact same.What is the expected behavior?
Things should work and shouldn't make me doubt my own code for days.
What do you see instead?
Nothing works, am frustrated and angry.
Additional information
Make it work, please.
The text was updated successfully, but these errors were encountered: