Skip to content

[v17.36.2]: Running into "Multiple possible build commands found" with builds disabled #6841

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

Closed
gfellerph opened this issue Sep 27, 2024 · 21 comments · Fixed by #7229
Closed
Assignees
Labels
area: command: deploy status: confirmed type: bug code to address defects in shipped code

Comments

@gfellerph
Copy link

Describe the bug

We're building our static page in a GitHub Action and deploy just the .zip. Therefore we disabled builds on netlify. Since the 20th of September 2024, our netlify deploy command fails with the error (https://github.com/swisspost/design-system/actions/runs/11066480112/job/30747794144):

Multiple possible build commands found
 ›   Error: Detected commands for: Hydrogen, Remix. Update your settings to specify which to use. Refer to https://ntl.fyi/dev-monorepo for more information.

However, our deploy command should disable builds:

netlify deploy --filter @swisspost/design-system-documentation --build false --dir ${{ steps.build.outputs.folder }} --alias $url_alias

Also, in the changelog there is a feature entry that does not seem to belong to any version (https://github.com/netlify/cli/blob/main/CHANGELOG.md#17362-2024-09-20).

image

Steps to reproduce

See build command and linked action runs above.

Configuration

https://github.com/swisspost/design-system/blob/main/packages/documentation/netlify.config.json

Environment

Not easy since we're installing the netlify cli only for action runs. I hope the information above is enough.

@gfellerph gfellerph added the type: bug code to address defects in shipped code label Sep 27, 2024
gfellerph added a commit to swisspost/design-system that referenced this issue Sep 27, 2024
Our last successful deploys were on the 20th of September. On that day,
netlify released a patch update that seems to have broken the deploy
command if netlify builds are disabled
(https://github.com/netlify/cli/blob/main/CHANGELOG.md#17362-2024-09-20).
Trying to fix the issue by setting netlify version to a version before
that.

Submited an issue for netlify cli:
netlify/cli#6841
@what1s1ove
Copy link

what1s1ove commented Oct 6, 2024

I have the same problem, and I cannot downgrade the versions of the Netlify CLI.

Moreover, the link in this error does not help to fix the problem.

Multiple possible build commands found
› Error: Detected commands for: Hydrogen, Remix. Update your settings to specify which to use. Refer to https://ntl.fyi/dev-monorepo for more information.

@nekomeowww
Copy link

Same issue here.

In our open source repository https://github.com/nolebase/integrations , we have a custom GitHub Actions manifest running with the following command:

netlify deploy --dir 'docs/.vitepress/dist' --prod --debug

which will produce:

Multiple possible build commands found
 ›   Warning: Error: Detected commands for: Hydrogen, Remix. Update your settings to specify which to use. Refer to https://ntl.fyi/dev-monorepo for more information.
 ›       at detectFrameworkSettings (file:///home/runner/setup-pnpm/node_modules/.bin/global/5/.pnpm/[email protected]_@[email protected]/node_modules/netlify-cli/dist/utils/build-info.js:71:19)
 ›       at async deploy (file:///home/runner/setup-pnpm/node_modules/.bin/global/5/.pnpm/[email protected]_@[email protected]/node_modules/netlify-cli/dist/commands/deploy/deploy.js:642:22)
 ›       at async BaseCommand.<anonymous> (file:///home/runner/setup-pnpm/node_modules/.bin/global/5/.pnpm/[email protected]_@[email protected]/node_modules/netlify-cli/dist/commands/deploy/index.js:105:5)
 ›       at async BaseCommand.parseAsync (/home/runner/setup-pnpm/node_modules/.bin/global/5/.pnpm/[email protected]/node_modules/commander/lib/command.js:935:5)
 ›       at async file:///home/runner/setup-pnpm/node_modules/.bin/global/5/.pnpm/[email protected]_@[email protected]/node_modules/netlify-cli/bin/run.js:27:3

nekomeowww added a commit to nolebase/integrations that referenced this issue Oct 9, 2024
oliverschuerch pushed a commit to swisspost/design-system that referenced this issue Oct 9, 2024
Our last successful deploys were on the 20th of September. On that day,
netlify released a patch update that seems to have broken the deploy
command if netlify builds are disabled
(https://github.com/netlify/cli/blob/main/CHANGELOG.md#17362-2024-09-20).
Trying to fix the issue by setting netlify version to a version before
that.

Submited an issue for netlify cli:
netlify/cli#6841
oliverschuerch pushed a commit to swisspost/design-system that referenced this issue Oct 9, 2024
Our last successful deploys were on the 20th of September. On that day,
netlify released a patch update that seems to have broken the deploy
command if netlify builds are disabled
(https://github.com/netlify/cli/blob/main/CHANGELOG.md#17362-2024-09-20).
Trying to fix the issue by setting netlify version to a version before
that.

Submited an issue for netlify cli:
netlify/cli#6841
oliverschuerch pushed a commit to swisspost/design-system that referenced this issue Oct 9, 2024
Our last successful deploys were on the 20th of September. On that day,
netlify released a patch update that seems to have broken the deploy
command if netlify builds are disabled
(https://github.com/netlify/cli/blob/main/CHANGELOG.md#17362-2024-09-20).
Trying to fix the issue by setting netlify version to a version before
that.

Submited an issue for netlify cli:
netlify/cli#6841
@zanhk
Copy link

zanhk commented Oct 13, 2024

Is there any workaround?

@peschee
Copy link

peschee commented Oct 13, 2024

Is there any workaround?

Yes, just pin the cli to the latest working version for now…

@zanhk
Copy link

zanhk commented Oct 13, 2024

Ok thanks

textbook added a commit to CodeYourFuture/gitbot that referenced this issue Oct 31, 2024
stefankuehnel added a commit to stefankuehnel/til that referenced this issue Nov 23, 2024
Currently it is not possible to deploy a page using the Netlify CLI
via GitHub Actions. This is due to the following error:

  Multiple possible build commands found
   ›   Error: Detected commands for: Hugo, Zola. Update your settings
              to specify which to use. Refer to https://ntl.fyi/dev-monorepo
	      for more information.

A bug report for this was submitted to Netlify's GitHub issue tracker
on 27 September 2024 [1]. However, a fix has not yet been provided.

Therefore, migrate from Netlify back to webgo.

Link: netlify/cli#6841 [1]
Signed-off-by: Stefan Kühnel <[email protected]>
@infomiho
Copy link

infomiho commented Dec 13, 2024

Any update on this issue? Hitting the same thing.

My netlify.toml file:

[build]
  publish = ".wasp/build/web-app/build/"

[[redirects]]
  from = "/*"
  to = "/index.html"
  status = 200
  force = false%    

@crisperdue
Copy link

This has been impacting my deploys lately also.

Experimentation showed that removing config.toml in the top level folder
avoided this misfeature. I use Hugo to build the site, and the standard
name of the config has changed in recent Hugo versions to hugo.toml (or yaml, ... ).
Changing the name of the config file to hugo.toml works around the issue for me.

@hjylewis
Copy link

I ran into this issue too

@hjylewis
Copy link

I found if you add this to your netlify.toml

[build]
command = "exit 0"

you avoid the error

@mklueh
Copy link

mklueh commented Apr 21, 2025

@hjylewis thanks, that will make the original issue disappear.

However, haven't managed to get anything working with 20.0.2, not sure if this is partially because of the command now.

I'm mainly running into ERROR: Could not resolve "tslib", using just the netlify deploy command after having build my application via Nuxt first into the dist directory.

Was running into that issue previously as well, but could workaround that using the netlify deploy --build flag. This won't work anymore and leads to similar issues regarding tslib

⠧ Hashing _nuxt\3zS2CfTW.js​
Bundling of function "server" failed
────────────────────────────────────────────────────────────────
​
  Error message
  Build failed with 180 errors:
  .netlify/functions-internal/server/node_modules/echarts/lib/chart/bar/BarSeries.js:44:26: ERROR: Could not resolve "tslib"
  .netlify/functions-internal/server/node_modules/echarts/lib/chart/bar/BarView.js:44:26: ERROR: Could not resolve "tslib"
  .netlify/functions-internal/server/node_modules/echarts/lib/chart/bar/BaseBarSeries.js:44:26: ERROR: Could not resolve "tslib"
  .netlify/functions-internal/server/node_modules/echarts/lib/chart/bar/PictorialBarSeries.js:44:26: ERROR: Could not resolve "tslib"
  .netlify/functions-internal/server/node_modules/echarts/lib/chart/bar/PictorialBarView.js:44:26: ERROR: Could not resolve "tslib"
  ...
​
  Error location
  While bundling function "server"

No idea what is wrong, but I guess some of us are stuck on v17.36.2 forever

@Florian-Mt
Copy link
Contributor

Florian-Mt commented Apr 22, 2025

Same issue for me, I am using netlify deploy --prod --dir dist --auth $TOKEN --site $SITE_ID. No build command, no --build option. That's pure nonsense.

The situation is:

  • src/commands/deploy.index.ts#L112 : the --build flag is false by default
  • src/commands/deploy/deploy.ts#804 : the deploy function, invoked by the command, calls a function detectFrameworkSettings(command, 'build'), regardless of whether or not the --build flag is present or not
  • src/utils/build-info.ts#L67 : this function then calls detectBuildSettings(command) and stores the result in a settings array
  • (some operations are performed to detect possible build commands, I do not care what happens here)
  • src/utils/build-info.ts#L88 : and eventually, detectFrameworkSettings throws because settings is length 2 or more

My opinion is that netlify-cli should not even try to detect anything related to my project since I did NOT trigger a build, I just want to push-deploy my already build project.

The joke is that const settings = await detectFrameworkSettings(command, 'build') is only used within an if (option.build) block!

We shall just move this call into the block, problem solved.

@serhalp
Copy link
Collaborator

serhalp commented Apr 23, 2025

Thanks so much for the investigation and the fix @Florian-Mt!

It looks like this may have regressed when that detection was introduced to the deploy command in 111967c (v17.33.4, although interestingly folks in this thread are using v17.36.2 successfully...).

@serhalp
Copy link
Collaborator

serhalp commented Apr 24, 2025

This should be fixed in v20.0.4. Can anyone here confirm? npm i -g netlify-cli@latest

Thanks!

@Florian-Mt
Copy link
Contributor

Yes, it works for me, thank you for publishing the fix.

@mklueh
Copy link

mklueh commented Apr 25, 2025

I found if you add this to your netlify.toml

[build]
command = "exit 0"

you avoid the error

@serhalp @Florian-Mt but can this be considered a real fix for the original problem, or rather a fix to make the hackaround work?

I feel like putting command = "exit 0" into every project of my monorepo feels like creating unnecessary mess, just to prevent an error that shouldn't even exist.

Imo this should be handled by the CLI

textbook added a commit to CodeYourFuture/gitbot that referenced this issue Apr 25, 2025
@goastler
Copy link

I wasted half a day trying to overcome this issue. Issue is present in v20.1.1 but not in v20.1.0

npm i -g [email protected] solves the issue

@serhalp
Copy link
Collaborator

serhalp commented Apr 28, 2025

@mklueh

@serhalp @Florian-Mt but can this be considered a real fix for the original problem, or rather a fix to make the hackaround work?

I feel like putting command = "exit 0" into every project of my monorepo feels like creating unnecessary mess, just to prevent an error that shouldn't even exist.

Imo this should be handled by the CLI

I think there's been a misunderstanding here. This is the fix. What you're referencing was a proposed workaround prior to the fix.

Are you using the latest netlify-cli and still needing the workaround? If so, could you please open a new issue? It sounds like that would be a separate issue.

@serhalp
Copy link
Collaborator

serhalp commented Apr 28, 2025

@goastler

I wasted half a day trying to overcome this issue. Issue is present in v20.1.1 but not in v20.1.0

Are you referring to the original issue in this thread, related to running netlify deploy without --build? If not, can you please open a new issue with reproduction steps?

Either way, could you share your stack (framework/bundler) and the full error message?

Thank you!

@goastler
Copy link

NETLIFY_AUTH_TOKEN=<token> npx netlify deploy --site 2da... --dir ./dist --message "local deploy from g-lt1"

If I run this using v20.1.1, I get "Multiple possible build commands found". v20.1.0 on the other hand works as expected, no problem

@Florian-Mt
Copy link
Contributor

I just ran it again and it still works for me in 20.1.1. You may use --debug to get more information. However, I agree with @serhalp, you should open a new issue as it looks like it is a different problem.

@serhalp
Copy link
Collaborator

serhalp commented Apr 28, 2025

@goastler can you please run this (from the same directory) and share the output?

npx @netlify/build-info

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: command: deploy status: confirmed type: bug code to address defects in shipped code
Projects
None yet
Development

Successfully merging a pull request may close this issue.