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

bun.lockb prevents auto imports #11037

Open
yus-ham opened this issue May 13, 2024 · 3 comments
Open

bun.lockb prevents auto imports #11037

yus-ham opened this issue May 13, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@yus-ham
Copy link
Contributor

yus-ham commented May 13, 2024

What version of Bun is running?

1.1.8

What platform is your computer?

Linux 6.8.0-31-generic x86_64 x86_64

What steps can reproduce the bug?

image

What is the expected behavior?

No response

What do you see instead?

No response

Additional information

No response

@yus-ham yus-ham added the bug Something isn't working label May 13, 2024
@Electroid
Copy link
Contributor

The intention is that if there is a bun.lockb / package.json, Bun will use that instead of auto-imports.

@yus-ham
Copy link
Contributor Author

yus-ham commented May 13, 2024

Version resolution
To determine which version to install, Bun follows the following algorithm:

  1. Check for a bun.lockb file in the project root. If it exists, use the version specified in the lockfile.
  2. Otherwise, scan up the tree for a package.json that includes "foo" as a dependency. If found, use the specified semver version or version range.
  3. Otherwise, use latest.

Maybe I misunderstood the docs explanation that auto import can coexist with bun.lockb or package.json and optionally uses them

@bdombro
Copy link

bdombro commented May 23, 2024

I too am confused -- would think auto-import shoudl work if those files exist and if they do, use the versions in those files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants