Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

File not found when running bun --config bunfig.toml #13070

Closed
joas8211 opened this issue Aug 4, 2024 · 2 comments
Closed

File not found when running bun --config bunfig.toml #13070

joas8211 opened this issue Aug 4, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@joas8211
Copy link

joas8211 commented Aug 4, 2024

What version of Bun is running?

1.1.21+70ca2b76c

What platform is your computer?

Linux 6.6.40-2-lts x86_64 unknown

What steps can reproduce the bug?

  1. Open an project folder with an empty bunfig.toml file.
  2. Run bun --config bunfig.toml

What is the expected behavior?

I'm expected to see list of possible commands outputted like when --config is not specified. Like so:

Bun is a fast JavaScript runtime, package manager, bundler, and test runner. (1.1.21+70ca2b76c)

Usage: bun <command> [...flags] [...args]

Commands:
  run       ./my-script.ts       Execute a file with Bun
            lint                 Run a package.json script
  test                           Run unit tests with Bun
  x         eslint               Execute a package binary (CLI), installing if needed (bunx)
  repl                           Start a REPL session with Bun
  exec                           Run a shell script directly with Bun

  install                        Install dependencies for a package.json (bun i)
  add       tailwindcss          Add a dependency to package.json (bun a)
  remove    babel-core           Remove a dependency from package.json (bun rm)
  update    elysia               Update outdated dependencies
  link      [<package>]          Register or link a local npm package
  unlink                         Unregister a local npm package
  patch <pkg>                    Prepare a package for patching
  pm <subcommand>                Additional package management utilities

  build     ./a.ts ./b.jsx       Bundle TypeScript & JavaScript into a single file

  init                           Start an empty Bun project from a blank template
  create    next-app             Create a new project from a template (bun c)
  upgrade                        Upgrade to latest version of Bun.
  <command> --help               Print help text for command.

Learn more about Bun:            https://bun.sh/docs
Join our Discord community:      https://bun.sh/discord

What do you see instead?

error: File not found: "bunfig.toml"

Additional information

I suspect this is the reason why project configuration options from bunfig.toml don't apply also when --config is not specified, like in these issues: #12990, #11445

Issue #12753 suggests also that some validation is happening before not found error is outputted.

Following issue could also be related to this: #12987.

@joas8211 joas8211 added bug Something isn't working needs triage labels Aug 4, 2024
@vktrl
Copy link
Contributor

vktrl commented Aug 15, 2024

You need to use this syntax: bun --config="bunfig.toml", otherwise the last arg is interpreted as the entrypoint.

@RiskyMH RiskyMH added enhancement New feature or request and removed bug Something isn't working needs triage labels Oct 12, 2024
@osdiab
Copy link

osdiab commented Nov 3, 2024

can confirm that if I specify --config=bunfig.toml then the issue in #11445 resolves itself (bun = true in the [run] section works). So the default behavior of using bunfig.toml I guess just doesn't work right now.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants