[HELP] Build not working properly

I’m doing a website for myself using lovable.dev. and the first time I upload the website do Netlify everything went smooth, I did a few changes on the website using lovable and the website updated automatically, no problems, yesterday I tried doing a new update, but it didn’t went thru, so unliked Netlify from the git repo and linked again, but I can’t either understand the error I get and nor understand the solution, I’m a first time sailor in the world so im seeking help my lovable website link is: clicksugar.netlify.app

and here are som screenshots of what I was able to see about the error

ERROR:
11:15:32 AM: Netlify Build
11:15:32 AM: ────────────────────────────────────────────────────────────────
11:15:32 AM: ​
11:15:32 AM: ❯ Version
11:15:32 AM: @netlify/build 29.59.1
11:15:32 AM: ​
11:15:32 AM: ❯ Flags
11:15:32 AM: accountId: 67b76823eb8ae40096adc3e4
11:15:32 AM: baseRelDir: true
11:15:32 AM: buildId: 67bf21b5d9cf788178c154a3
11:15:32 AM: deployId: 67bf21b5d9cf788178c154a5
11:15:32 AM: ​
11:15:32 AM: ❯ Current directory
11:15:32 AM: /opt/build/repo
11:15:32 AM: ​
11:15:32 AM: ❯ Config file
11:15:32 AM: No config file was defined: using default values.
11:15:32 AM: ​
11:15:32 AM: ❯ Context
11:15:32 AM: production
11:15:32 AM: ​
11:15:32 AM: Build command from Netlify app
11:15:32 AM: ────────────────────────────────────────────────────────────────
11:15:32 AM: ​
11:15:32 AM: $ bun run
11:15:32 AM: mise ERROR Tool not installed for shim: bun
11:15:32 AM: Missing tool version: core:bun@1.2.3
11:15:32 AM: Install all missing tools with: mise install
11:15:32 AM: mise ERROR Run with --verbose or MISE_VERBOSE=1 for more information
11:15:32 AM: ​
11:15:32 AM: “build.command” failed
11:15:32 AM: ────────────────────────────────────────────────────────────────
11:15:32 AM: ​
11:15:32 AM: Error message
11:15:32 AM: Command failed with exit code 1: bun run (Search results for '"non-zero exit code: 1"' - Netlify Support Forums)
11:15:32 AM: ​
11:15:32 AM: Error location
11:15:32 AM: In Build command from Netlify app:
11:15:32 AM: bun run
11:15:32 AM: ​
11:15:32 AM: Resolved config
11:15:32 AM: build:
11:15:32 AM: command: bun run
11:15:32 AM: commandOrigin: ui
11:15:32 AM: publish: /opt/build/repo/dist
11:15:32 AM: publishOrigin: ui
11:15:33 AM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2 (Search results for '"non-zero exit code: 2"' - Netlify Support Forums)
11:15:33 AM: Build failed due to a user error: Build script returned non-zero exit code: 2
11:15:33 AM: Failing build: Failed to build site
11:15:33 AM: Finished processing build request in 1m10.235s

ASK NETLFY ASNWER:

Diagnosis: The build failure seems to be caused by missing dependencies.

Solution:

  1. Verify that all the required packages are listed in the package.json file or have been committed to the repository.
  2. If the packages are missing, add them to the package.json file.
  3. Make sure all necessary files are committed to the repository before attempting the build again.

@theaudiodesigner See the discussion in this thread, as it appears to be related:
https://answers.netlify.com/t/build-crashing-after-bun-1-2/138329
(Issues working with Bun 1.2 on Netlify, same error message)

Thank you @nathanmartin I will read the this thread

i have tried their solution but I ran into the same problem :confused:

1:37:23 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2 (Search results for '"non-zero exit code: 2"' - Netlify Support Forums)
1:37:22 PM: Deploy site
1:37:22 PM: ────────────────────────────────────────────────────────────────
1:37:22 PM: ​
1:37:22 PM: Section completed: deploying
1:37:22 PM: ​
1:37:22 PM: Configuration error
1:37:22 PM: ────────────────────────────────────────────────────────────────
1:37:22 PM: ​
1:37:22 PM: Error message
1:37:22 PM: Deploy did not succeed: Deploy directory ‘dist’ does not exist
1:37:22 PM: ​
1:37:22 PM: Resolved config
1:37:22 PM: build:
1:37:22 PM: command: bun run
1:37:22 PM: commandOrigin: ui
1:37:22 PM: publish: /opt/build/repo/dist
1:37:22 PM: publishOrigin: ui
1:37:23 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
1:37:23 PM: Failing build: Failed to build site

@theaudiodesigner You’ve not run into ‘the same problem’, you’ve encountered a ‘different problem’.

Your ‘original problem’ was:

11:15:32 AM: mise ERROR Tool not installed for shim: bun
11:15:32 AM: Missing tool version: core:bun@1.2.3
...
11:15:32 AM: “build.command” failed

Your ‘new problem’ is:

1:37:22 PM: Error message
1:37:22 PM: Deploy did not succeed: Deploy directory ‘dist’ does not exist

It’s as per the answer that you generated with Netlify’s AI tooling.

Your publish directory is set to dist, which you can see here:

1:37:22 PM: Resolved config
1:37:22 PM: build:
1:37:22 PM: command: bun run
1:37:22 PM: commandOrigin: ui
1:37:22 PM: publish: /opt/build/repo/dist   <-- Here
1:37:22 PM: publishOrigin: ui

When Netlify’s build system tries to deploy that directory it cannot find it.

You just need to ensure the directory is being created correctly.

The easiest way to check what is happening is to run your build command on your local system.

If you find that the folder your project needs to deploy is something other than dist, you would then update your build configuration to the actual directory that you want to deploy.

If you find your project is supposed to output dist, but isn’t (for whatever reason), then you would fix it.

Thank you @nathanmartin it worked!