Skip to content

workspace member package can't depend on workspace root #2773

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

Open
coratgerl opened this issue Apr 29, 2023 · 5 comments
Open

workspace member package can't depend on workspace root #2773

coratgerl opened this issue Apr 29, 2023 · 5 comments
Assignees
Labels
bug Something isn't working bun install Something that relates to the npm-compatible client

Comments

@coratgerl
Copy link
Contributor

coratgerl commented Apr 29, 2023

What platform is your computer?

Darwin 22.4.0 arm64 arm

How did you attempt to install or upgrade?

I try to do bun install in a monorepo with the structure below:

  • root folder
    • packages folder
      • package a (with root folder in devDep)
      • package b (with root folder in devDep)

When the package a has the root folder in devDep, that provokes a segmentation fault :
image

If I remove the devDep, the bun install command is correctly launch.

What do you see instead?

image

Additional information

Code in test/cli/install/bun-install.test.ts to reproduce:

it("should handle inter-dependency between root and workspaces without segmentation fault", async () => {
  await writeFile(
    join(package_dir, "package.json"),
    JSON.stringify({
      name: "Foo",
      version: "0.0.1",
      workspaces: ["bar", "packages/baz"],
    }),
  );
  await mkdir(join(package_dir, "bar"));
  await writeFile(
    join(package_dir, "bar", "package.json"),
    JSON.stringify({
      name: "Bar",
      version: "0.0.2",
      devDependencies: {
        Foo: "workspace:0.0.1",
      },
    }),
  );

  const { exited } = spawn({
    cmd: [bunExe(), "install"],
    cwd: package_dir,
    stdout: null,
    stdin: "pipe",
    stderr: "pipe",
    env,
  });

  expect(await exited).toBe(0);
});
@coratgerl coratgerl added the bug Something isn't working label Apr 29, 2023
@Jarred-Sumner
Copy link
Collaborator

Thank you for the test!

@Jarred-Sumner
Copy link
Collaborator

Can you upload your bun.lockb?

@coratgerl
Copy link
Contributor Author

coratgerl commented Apr 30, 2023

In this case I don't have the bun.lockb file because the bun install crash before his generation.

@mindreframer
Copy link

@Jarred-Sumner I have a similar case with a repro:

It only happens in one folder, which had Svelte configs in it.

@Electroid Electroid added crash An issue that could cause a crash bun install Something that relates to the npm-compatible client labels Oct 26, 2023
@Jarred-Sumner
Copy link
Collaborator

Jarred-Sumner commented Nov 15, 2023

Status as of Bun v1.0.11

  • This no longer has a segmentation fault
  • Workspace member packages cannot yet have a dependency set to the root package

@Jarred-Sumner Jarred-Sumner changed the title Segmentation fault on bun install with workspace workspace member package can't depend on workspace root Nov 15, 2023
@robobun robobun changed the title workspace member package can't depend on workspace root workspace member package can't depend on workspace root Nov 15, 2023
@dylan-conway dylan-conway self-assigned this Jul 22, 2024
@nektro nektro removed the crash An issue that could cause a crash label Oct 22, 2024
@coratgerl coratgerl reopened this Apr 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working bun install Something that relates to the npm-compatible client
Projects
None yet
Development

No branches or pull requests

6 participants