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

Warning when using text-based Bun lockfile #9628

Closed
1 task done
robertherber opened this issue Dec 18, 2024 · 10 comments · Fixed by #9783
Closed
1 task done

Warning when using text-based Bun lockfile #9628

robertherber opened this issue Dec 18, 2024 · 10 comments · Fixed by #9783
Labels
bun kind: bug Something isn't working

Comments

@robertherber
Copy link

robertherber commented Dec 18, 2024

Verify canary release

  • I verified that the issue exists in the latest Turborepo canary release.

Link to code that reproduces this issue

https://github.com/robertherber/repro-turbo-with-bun-text-based-lockfile

Which canary version will you have in your reproduction?

2.3.4-canary.3

Enviroment information

CLI:
   Version: 2.3.3
   Path to executable: /Users/robertherber/code/_play/turbo-bun-text-based/node_modules/turbo-darwin-arm64/bin/turbo
   Daemon status: Running
   Package manager: bun

Platform:
   Architecture: aarch64
   Operating system: macos
   WSL: false
   Available memory (MB): 25846
   Available CPU cores: 10

Environment:
   CI: None
   Terminal (TERM): xterm-256color
   Terminal program (TERM_PROGRAM): WarpTerminal
   Terminal program version (TERM_PROGRAM_VERSION): v0.2024.12.10.15.55.stable_03
   Shell (SHELL): /bin/zsh
   stdin: false

Expected behavior

I expect it to work without a warning.

Actual behavior

Getting a very noisy warning whenever I run a turbo command:

 WARNING  Issues occurred when constructing package graph. Turbo will function, but some features may not be available:
   × could not resolve workspaces
  ╰─▶ unable to parse: Parsing Error: Error { input: "one-plus-one@^workspace:packages/one-plus-one:\n  version \"workspace:packages/one-plus-one\"\n  resolved \"workspace:packages/one-plus-one\"\n  devDependencies:\n    \"@types/bun\" \"latest\"\n\nturbo@^2.3.3:
      \n  version \"2.3.3\"\n  resolved \"https://registry.npmjs.org/turbo/-/turbo-2.3.3.tgz\"\n  integrity sha512-DUHWQAcC8BTiUZDRzAYGvpSpGLiaOQPfYXlCieQbwUvmml/LRGIe3raKdrOPOoiX0DYlzxs2nH6BoWJoZrj8hA==\n  optionalDependencies:\n    turbo-darwin-64 \"2.3.3\"\n    turbo-
      darwin-arm64 \"2.3.3\"\n    turbo-linux-64 \"2.3.3\"\n    turbo-linux-arm64 \"2.3.3\"\n    turbo-windows-64 \"2.3.3\"\n    turbo-windows-arm64 \"2.3.3\"\n\[email protected]:\n  version \"2.3.3\"\n  resolved \"https://registry.npmjs.org/turbo-darwin-64/-/turbo-
      darwin-64-2.3.3.tgz\"\n  integrity sha512-bxX82xe6du/3rPmm4aCC5RdEilIN99VUld4HkFQuw+mvFg6darNBuQxyWSHZTtc25XgYjQrjsV05888w1grpaA==\n\[email protected]:\n  version \"2.3.3\"\n  resolved \"https://registry.npmjs.org/turbo-darwin-arm64/-/turbo-darwin-arm64-
      2.3.3.tgz\"\n  integrity sha512-DYbQwa3NsAuWkCUYVzfOUBbSUBVQzH5HWUFy2Kgi3fGjIWVZOFk86ss+xsWu//rlEAfYwEmopigsPYSmW4X15A==\n\[email protected]:\n  version \"2.3.3\"\n  resolved \"https://registry.npmjs.org/turbo-linux-64/-/turbo-linux-64-2.3.3.tgz\"\n  integrity
      sha512-eHj9OIB0dFaP6BxB88jSuaCLsOQSYWBgmhy2ErCu6D2GG6xW3b6e2UWHl/1Ho9FsTg4uVgo4DB9wGsKa5erjUA==\n\[email protected]:\n  version \"2.3.3\"\n  resolved \"https://registry.npmjs.org/turbo-linux-arm64/-/turbo-linux-arm64-2.3.3.tgz\"\n  integrity sha512-NmDE/
      NjZoDj1UWBhMtOPmqFLEBKhzGS61KObfrDEbXvU3lekwHeoPvAMfcovzswzch+kN2DrtbNIlz+/rp8OCg==\n\[email protected]:\n  version \"2.3.3\"\n  resolved \"https://registry.npmjs.org/turbo-windows-64/-/turbo-windows-64-2.3.3.tgz\"\n  integrity sha512-O2+BS4QqjK3dOERscXqv7N2GXNcqHr9hXumkMxDj/
      oGx9oCatIwnnwx34UmzodloSnJpgSqjl8iRWiY65SmYoQ==\n\[email protected]:\n  version \"2.3.3\"\n  resolved \"https://registry.npmjs.org/turbo-windows-arm64/-/turbo-windows-arm64-2.3.3.tgz\"\n  integrity sha512-dW4ZK1r6XLPNYLIKjC4o87HxYidtRRcBeo/hZ9Wng2XM/
      MqqYkAyzJXJGgRMsc0MMEN9z4+ZIfnSNBrA0b08ag==\n\ntypescript@^5.0.0:\n  version \"5.7.2\"\n  resolved \"https://registry.npmjs.org/typescript/-/typescript-5.7.2.tgz\"\n  integrity sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==\n\nundici-types@~5.26.4:\n
      version \"5.26.5\"\n  resolved \"https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz\"\n  integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==\n", code: Eof }

• Packages in scope: one-plus-one
• Running typecheck in 1 packages
• Remote caching disabled
one-plus-one:typecheck: cache miss, executing 284ac7686cc4f234
one-plus-one:typecheck: 
one-plus-one:typecheck: $ tsc --noEmit

 Tasks:    1 successful, 1 total
Cached:    0 cached, 1 total
  Time:    706ms

The command still works though.

To Reproduce

Here's a simple repo reproduction:
https://github.com/robertherber/repro-turbo-with-bun-text-based-lockfile

Just run bun typecheck in the root and the warning is there (as above).

Additional context

Using bun 1.1.39 with a text-based lockfile (verified I'm getting the same on 1.1.40 and 1.1.41).

@robertherber robertherber added kind: bug Something isn't working needs: triage New issues get this label. Remove it after triage labels Dec 18, 2024
@chris-olszewski chris-olszewski removed the needs: triage New issues get this label. Remove it after triage label Dec 23, 2024
@anthonyshew anthonyshew added the bun label Jan 13, 2025 — with Linear
@firtoz
Copy link

firtoz commented Jan 23, 2025

Update: the text based lockfile for bun (bun.lock) is now live with bun 1.2: https://bun.sh/blog/bun-v1.2 - January 22, 2025

@robertherber
Copy link
Author

Update: the text based lockfile for bun (bun.lock) is now live with bun 1.2: bun.sh/blog/bun-v1.2 - January 22, 2025

Yeah, now it's even on by default for new projects. So this just became more important :)

@raulfdm
Copy link

raulfdm commented Jan 24, 2025

I'm not only getting a warning but a full build failure.

envinfo 👇🏽

  System:
    OS: macOS 15.2
    CPU: (10) arm64 Apple M1 Pro
    Memory: 203.33 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.13.1 - ~/Library/pnpm/node
    npm: 10.5.2 - ~/Library/pnpm/npm
    bun: 1.2.0 - ~/.bun/bin/bun
    Watchman: 2024.12.02.00 - /opt/homebrew/bin/watchman
  npmPackages:
    turbo: 2.3.3 => 2.3.3 

Using bun.lockb, building with turbo works as expected. Deleting this file and using bun.lock (text-based), because of this warning (probably something doesn't get resolved), the build breaks.

@hussain7college
Copy link

I get this error when trying to bun dev:

$ turbo dev
turbo 2.4.0

• Packages in scope: @repo/backend, @repo/dashboard, @repo/db, @repo/hooks, @repo/storage, @repo/theme, @repo/tsconfig, @repo/utils
• Running dev in 8 packages
• Remote caching disabled
┌ @repo/dashboard#dev > cache bypass, force executing 5185635efd57c246 
│ $ next dev --turbo -p 3010
│    ▲ Next.js 15.1.6 (Turbopack)
│    - Local:        http://localhost:3010
│    - Network:      http://192.168.0.113:3010
│    - Environments: .env
│    - Experiments (use with caution):
│      · turbo
│ 
│  ✓ Starting...
│ FATAL: An unexpected Turbopack error occurred. Please report the content of /tmp/next-panic-994f2fdad9fede37b38210f8d8c
│ 18e62.log, along with a description of what you were doing when the error occurred, to https://github.com/vercel/next.j
│ s/issues/new
│ [Error [TurbopackInternalError]: Next.js package not found
│ 
│ Debug info:
│ - Execution of get_entrypoints_with_issues failed
│ - Execution of Project::entrypoints failed
    ...Finishing writing to cache...                                                                                                        │ - Execution of AppProject::routes failed
│ - Execution of directory_tree_to_entrypoints_internal failed
│ - Execution of *FileSystemPath::join failed
│ - Execution of get_next_package failed
│ - Next.js package not found]
└────>
>   ...Finishing writing to cache...                                                                                                        ┌ @repo/backend#dev > cache bypass, force executing 238cac8f9086d8da 
│ $ bun run --watch src/server.ts
│ error: ENOENT reading "/home/hussain7abbas/projects/turbo-starter/packages/db/node_modules/@prisma/client"
└────>
 ERROR  run failed: command  exited (1)
error: script "dev" exited with code 1

I solved it by creating empty bun.lockb file beside the bun.lock file, thanks alimehasin for solving it for me.

@km-tr
Copy link

km-tr commented Feb 12, 2025

@chris-olszewski

I tried updating to 2.4.1, but it still gives a warning.

Image

@darklight9811
Copy link

@km-tr are you sure all your workspaces contain a name?

@km-tr
Copy link

km-tr commented Feb 12, 2025

@darklight9811

Looking inside bun.lock, I found the following content.
From the contents of dependencies, I assume it reflects the package.json at the root of the repository.
However, the name is also set in the root package.json.

 "workspaces": {
    "": {

@darklight9811
Copy link

@km-tr this is related to the package file position, not package name.

@km-tr
Copy link

km-tr commented Feb 12, 2025

@darklight9811

In any case, all workspaces have names.

@carlosmfreitas2409
Copy link

carlosmfreitas2409 commented Feb 14, 2025

I'm having the same missing field 'name' warning.

Image

All workspaces, including the root, have names.
I am using Biome (I saw a change in Biome in the linked PR; I don't know if it could be related).

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

Successfully merging a pull request may close this issue.

9 participants