Specific branch context not running branch command

Hi,

I’m trying to deploy a site on an specific branch named “preview” (https://preview-guidedogs-qa.netlify.app) with different context from the main site (https://guidedogs-qa.netlify.app). The code in the netlify.toml file is:

[build]
	functions = "functions"
	base = "/"
	command = "npm run build"

[[plugins]]
    package = "netlify-plugin-cache-nextjs"

[context.production]
	publish = "out/"
	command = "npm run export"

# Deploy Preview context: all deploys generated from
# a pull/merge request will inherit these settings.
#[context.deploy-preview]
#  command = "echo branch"

# Here is an example of how to define context-specific
# environment variables. To avoid committing sensitive
# values to public source repositories, set variables
# with the Netlify UI, CLI, or API instead.
#[context.deploy-preview.environment]
#  command = "echo branch"

# Branch Deploy context: all deploys that are not from
# a pull/merge request or from the Production branch
# will inherit these settings.
#[context.branch-deploy]
#  command = "echo branch"
#[context.branch-deploy.environment]
#  NODE_ENV = "development"

# Dev context: environment variables set here
# are available for local development environments
# run using Netlify Dev. These values can be
# overwritten on branches that have a more specific
# branch context configured.
[context.dev.environment]
  NODE_ENV = "development"

# Specific branch context: all deploys from
# this specific branch will inherit these settings.
[context.preview]
	command = "npm run build"

  [context.preview.environment]
    UNIFORM_BUILD_MODE="ssr"

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

Deploy details | Deploys | preview-guidedogs-qa | Netlify

I need the deployment for the preview branch to run the command “npm run build” but it’s always running “npm run export” that is the production context command.

Could you please point me to what I’m missing?
Thanks in advance

Ana

preview seems to be your production branch. Why not just specify the settings directly in build?