Netlify Deploy Plugin Configuration Error

Hi there,

I am getting errors with my deploy to Netlify via bitbucket pipelines.

When I run the following during my pipeline:

netlify deploy --site=$NETLIFY_SITE_ID_STAGING --auth=$NETLIFY_AUTH_TOKEN --dir=.next --message="Deploying Staging" --build --prod

I get the following error:

Netlify Build                                                
────────────────────────────────────────────────────────────────

❯ Version
  @netlify/build 29.51.3

❯ Flags
  {}

Configuration error                                          
────────────────────────────────────────────────────────────────

  Error message
  When resolving config file /opt/atlassian/pipelines/agent/build/netlify.toml:
  Plugin "@netlify/plugin-nextjs" must not be specified twice in the app

Here is my netlify.toml file:

[[plugins]]
package = "@netlify/plugin-nextjs"

[build]
command = "next build"
publish = ".next"

Any ideas?

Sitename: staging.mintyy.com.au

I am experiencing the same issue in my GitHub pipeline for the past 2 days when running the command: netlify deploy --build --prod. Other pipelines that deploy to lower environments succeed but this one consistently fails even though the pipelines are almost identical.

Following this thread for any details on the issue!

Edit: I was just able to get my site to deploy. I’m not sure if it was something I did or something on Netlfiy’s side that changed. But I went into my Build & Deploy Site configurations in the UI and removed all values I had set in the “Build Settings” panel since I have a netlify.toml file that handles those configurations anyway.

I’m also seeing this. I removed the Runtime setting in the Netlify UI and also removed the [[plugin]] section from my netlify.toml and the error went away and still the plug-in is used. I guess the netlify cli is detecting it itself now?

Hey Alex,

Thanks for letting me know - this is similar to what Netlify AI Bot suggested.

Where in the configuration settings did you find the Build Settings?

I remember having these settings in the past, but they seem to have disappeared. It might be because I’m on a free plan.

Under Site Configuration I have > Build & Deploy:

  1. Continuous Deployment
  2. Post Processing
  3. Split Testing
  4. Deploy Notifications

There’s no options for build settings as I have seen in the past.

Under Continuous Deployment I only have:

  1. Repository (Not used)
  2. Functions Region (Premium only)
  3. Automatic Deploy Deletion (Premium only)

The Netlify docs have this info (Build configuration overview | Netlify Docs)


Set the build command

You can manually set the build command in the following ways:

To find the typical build command for your framework, refer to the frameworks doc.


I can’t see the Build Settings in the UI for my site, even when I click the link.

Any ideas?

Hi @eamonm,

Sorry for the issue. I’ve made a change on our end to hopefully resolve this issue. Could you give it another try and let us know if you’re seeing the same error?

Hi @alex-finley,

Sorry to hear you’re running into this issue. Could you let us know the sitename that you’re seeing this issue? For example: sitename.netlify.app. That’ll help us investigate further. Thanks!

Hi @pcreehan,

Sorry that you’re also running into this issue. Could you also let us know the sitename that you’re seeing this issue? For example: sitename.netlify.app. That’ll help the support team investigate further. Thank you!

engage-flow-runtime.netlify.app is one such example. I figured out it was just when it’s specified in the UI. Regardless of whether I have it in the netlify.toml file, if I specified the Next.js runtime in the ui, I’d get the error.

Hey Melvin,

Thanks for fixing - can confirm my deploys are going through again, no changes were needed from my end ^.^

Hey Melvin,

I’ve managed to deploy successfully to staging and UAT, but for some reason my production site is still causing errors. Same error as last time - Plugin "@netlify/plugin-nextjs" must not be specified twice in the app

Site - www.mintyy.com.au

+ netlify deploy --site=$NETLIFY_SITE_ID_PRODUCTION --auth=$NETLIFY_AUTH_TOKEN --dir=.next --message="Deploying Production" --build --prod
​
Netlify Build                                                 
────────────────────────────────────────────────────────────────
​
❯ Version
  @netlify/build 29.51.4
​
❯ Flags
  {}
​
Configuration error                                           
────────────────────────────────────────────────────────────────
​
  Error message
  When resolving config file /opt/atlassian/pipelines/agent/build/netlify.toml:
  Plugin "@netlify/plugin-nextjs" must not be specified twice in the app

Hi @eamonm,

Apologies for the delay. Could you try again and let us know if you’re still seeing the error?

Thanks Melvin,

I have deployed successfully.

Cheers

Hi, I’m getting the same error Plugin "@netlify/plugin-nextjs" must not be specified twice in the app

when running

netlify build
# netlify-cli/17.33.5 darwin-x64 node-v20.12.2

We’ve been asking a site name or ID to everyone involved.

Same issue for me, site id
a2f4caf4-d5af-4fbe-9d98-0ec49f54c32b

We also facing this issue with site ids: f416057f-dd98-4cc4-8fcd-c02f6ad44545, 116956ea-7ecc-4dfe-9717-c671d8758123 and ec265feb-bf84-4f7e-9a0e-4b2fb1813995.

Same issue here, site id below
63d5de0c-7566-4dff-8090-8db7eb001f9e

Same error here:

3c28689b-5379-431b-93ef-c57f85a20f0b

Hi, we are still facing this issue.

Hi @jlevinger,

Apologies for the delay. Could you try again and let us know if you’re still seeing issues?