For AI agents and LLMs: a machine-readable index is available at llms.txt. A plain-Markdown version of any documentation page is available by appending .md to its URL.
Skip to main content

Comprehensive Troubleshooting Guide for SmartUI

This comprehensive troubleshooting guide covers common issues you may encounter when using SmartUI for visual regression testing. Each issue includes symptoms, possible causes, and step-by-step solutions.

Quick Diagnostic Checklist

Before diving into specific issues, run through this quick checklist:

  • Project token is set correctly (PROJECT_TOKEN environment variable)
  • SmartUI CLI is installed and up-to-date (npx smartui --version)
  • Configuration file (.smartui.json) exists and is valid JSON
  • Network connectivity to TestMu AI servers
  • Project exists in SmartUI dashboard
  • Credentials (for Hooks) are set correctly (LT_USERNAME, LT_ACCESS_KEY)
  • Project name matches exactly (case-sensitive)

Troubleshooting by Category

Verified

Issue: Screenshots Not Appearing in Dashboard

Symptoms:

  • Tests run successfully but no screenshots appear in SmartUI dashboard
  • Build appears empty in dashboard
  • No error messages in logs

Possible Causes:

  • Project token not set or incorrect
  • Project name mismatch
  • Network connectivity issues
  • CLI not installed or outdated
  • Configuration file issues

Solutions:

  1. Verify Project Token:

    echo $PROJECT_TOKEN

    If empty, set it:

    export PROJECT_TOKEN="123456#1234abcd-****-****-****-************"
  2. Check Project Name: Verify project name in dashboard matches exactly (case-sensitive)

  3. Verify SmartUI CLI Installation:

    npx smartui --version

    If outdated, update:

    npm install -g @lambdatest/smartui-cli@latest
  4. Check Network Connectivity:

    curl -I https://smartui.lambdatest.com
  5. Review Test Execution Logs: Look for error messages or warnings in test output

Related Documentation: Project Settings, Running Your First Project


Issue: "Project Not Found" Error

Symptoms:

  • Error message: "Project not found" or "Invalid project token"
  • Tests fail to start
  • Authentication errors

Possible Causes:

  • Incorrect project token
  • Project deleted or renamed
  • Token from wrong project
  • Extra spaces or quotes in token
  • Token format incorrect

Solutions:

  1. Verify Project Exists:

  2. Copy Token Directly:

    • Go to Project Settings in dashboard
    • Copy project token directly (don't type manually)
    • Ensure token includes project ID prefix (e.g., 123456#...)
  3. Check Token Format:

    • Token should be in format: PROJECT_ID#TOKEN_VALUE
    • No extra spaces before or after
    • No quotes needed when setting environment variable
  4. Verify Token Scope:

    • Ensure token is from the correct project
    • Check if project was moved or renamed

Related Documentation: Project Settings


Issue: Credentials Not Working (Hooks)

Symptoms:

  • Tests fail with authentication errors
  • "Invalid credentials" message
  • Connection refused errors

Possible Causes:

  • LT_USERNAME or LT_ACCESS_KEY not set
  • Incorrect credentials
  • Credentials from wrong account
  • Environment variables not exported

Solutions:

  1. Verify Credentials Are Set:

    echo $LT_USERNAME
    echo $LT_ACCESS_KEY
  2. Get Correct Credentials:

  3. Set Credentials Correctly:

    export LT_USERNAME="your_username"
    export LT_ACCESS_KEY="your_access_key"

Related Documentation: Selenium Visual Regression, Playwright Visual Regression


Issue: CLI Installation and Version Management

Symptoms:

  • "command not found: smartui" error
  • CLI commands not working
  • Using outdated CLI version
  • Inconsistent behavior between terminals

Possible Causes:

  • CLI not installed globally
  • CLI installed locally but not accessible
  • Using outdated version
  • Multiple versions installed
  • PATH not configured correctly

Solutions:

  1. Understanding Global vs Local Installation:

    Global Installation (-g flag):

    • Installs CLI system-wide, accessible from any terminal
    • Command available as smartui directly
    • Requires administrator/sudo privileges
    • Best for: Single user, consistent environment
   npm install -g @lambdatest/smartui-cli

Local Installation (without -g):

  • Installs CLI in project's node_modules
  • Access via npx smartui or ./node_modules/.bin/smartui
  • No admin privileges needed
  • Best for: Project-specific versions, CI/CD pipelines
   npm install @lambdatest/smartui-cli
npx smartui --version
  1. Installing Latest Versions:

    SmartUI CLI:

    # Global installation (latest)
    npm install -g @lambdatest/smartui-cli@latest

    # Local installation (latest)
    npm install @lambdatest/smartui-cli@latest

    # Using npx (always uses latest)
    npx @lambdatest/smartui-cli@latest --version

    SmartUI Storybook CLI:

    # Global installation (latest)
    npm install -g @lambdatest/smartui-storybook@latest

    # Local installation (latest)
    npm install @lambdatest/smartui-storybook@latest

    # Using npx (always uses latest)
    npx @lambdatest/smartui-storybook@latest --version
  2. Checking Current Version:

    # If installed globally
    smartui --version

    # If installed locally or using npx
    npx smartui --version
  3. Updating to Latest Version:

    # Global update
    npm update -g @lambdatest/smartui-cli

    # Local update
    npm update @lambdatest/smartui-cli

    # Force reinstall latest
    npm install -g @lambdatest/smartui-cli@latest --force
  4. Resolving "Command Not Found":

    If installed globally:

    • Verify npm global bin is in PATH:
      echo $PATH | grep -i node
      npm config get prefix
    • Add to PATH if missing:
      # macOS/Linux - Add to ~/.bashrc or ~/.zshrc
      export PATH="$PATH:$(npm config get prefix)/bin"

    If installed locally:

    • Always use npx prefix:
      npx smartui --version
      npx smartui exec -- <command>
    • Or use direct path:
      ./node_modules/.bin/smartui --version
  5. Best Practices:

    • For Development: Use local installation with npx for project-specific versions
    • For CI/CD: Use npx @lambdatest/smartui-cli@latest to ensure latest version
    • For Global Use: Install globally with -g flag for convenience
    • Version Pinning: Use specific versions in package.json for reproducible builds

Related Documentation: CLI Complete Reference, Running Your First Project


Error Message Reference

When a SmartUI CLI command fails, it prints a plain-text message. This section lists those messages exactly as the CLI prints them, what each one means, and what to do.

Some messages end with details from your run, such as a file name or the reason the server gave. Those details are shown here as . For many failures, the CLI prints the underlying reason just above the message.

Documented for @lambdatest/smartui-cli v4.1.81.

Authentication and Setup

Authentication failed

FieldValue
MessageAuthentication failed
What happenedThe CLI could not authenticate with SmartUI. When the server gives a reason, the CLI prints that reason instead.
What to doCheck LT_USERNAME, LT_ACCESS_KEY, and your project token. The project token uses the format PROJECT_ID#TOKEN_VALUE. See Project Not Found above.

SmartUI capabilities are missing in env variables or in driver capabilities

FieldValue
MessageSmartUI capabilities are missing in env variables or in driver capabilities
What happenedAn SDK run needed to create a build, but no SmartUI settings were found in environment variables or in driver capabilities.
What to doSet the SmartUI environment variables before the run, or pass them in your driver capabilities. See SmartUI SDK Environment Variables.

Configuration File

Invalid config; web config must have either customViewports or both browsers and viewports

FieldValue
MessageInvalid config; web config must have either customViewports or both browsers and viewports
What happenedThe web block in your config does not say which screens to capture.
What to doIn the web block, set either customViewports, or both browsers and viewports.

Invalid config; rejectionThreshold must be greater than approvalThreshold

FieldValue
MessageInvalid config; rejectionThreshold must be greater than approvalThreshold
What happenedThe rejection threshold is not greater than the approval threshold.
What to doSet rejectionThreshold to a value higher than approvalThreshold.

customViewports is only supported for the exec command. Use browsers and viewports instead.

FieldValue
MessagecustomViewports is only supported for the exec command. Use browsers and viewports instead.
What happenedcustomViewports was set for a command other than exec.
What to doDefine browsers and viewports instead, or use the exec command.

No URLs found in the specified config file

FieldValue
MessageNo URLs found in the specified config file -> …
What happenedThe file listing the URLs to capture contains none.
What to doAdd at least one URL to the file. See Capture Static URLs via CLI.

Web Static Config file not found

FieldValue
MessageWeb Static Config file … not found.
What happenedThe static config file named in the command does not exist at that path.
What to doCheck the path, or run the command from the directory that contains the file.
Also seen asInvalid Web Static Config; …

Invalid customCSS file type

FieldValue
MessageInvalid customCSS file type: … Only .css files are supported.
What happenedcustomCSS points to a file that is not a .css file.
What to doPoint customCSS at an existing .css file.
Also seen ascustomCSS file not found: … · customCSS path is not a file: … · customCSS must be a non-empty string · customCSS cannot be empty

Builds and Uploads

SmartUI build creation failed

FieldValue
MessageSmartUI build creation failed
What happenedThe CLI could not create a build.
What to doRead the reason printed with it. Build creation failed: Build ID is empty means the server returned no build ID; run the command again.
Also seen asError while creation of build: … · Build creation failed: Build ID is empty

Finalize build failed

FieldValue
MessageFinalize build failed
What happenedThe build could not be finalized. The reason is printed just above the message.
What to doFix the problem it names, then run the command again.

Uploading screenshots failed

FieldValue
MessageUploading screenshots failed
What happenedThe screenshots could not be uploaded. The reason is printed just above the message.
What to doFix the problem it names, then run the upload again. See Upload your Screenshots via CLI.

PDF upload failed

FieldValue
MessagePDF upload failed
What happenedThe PDFs could not be uploaded. The reason is printed just above the message.
What to doFix the problem it names, then run the upload again. See Upload PDFs via CLI.

Project ID not found to fetch PDF results

FieldValue
MessageProject ID not found to fetch PDF results
What happenedThe CLI had no project ID when it tried to fetch PDF results.
What to doRun the upload again. If it happens again, contact support.

Snapshot processing failed

FieldValue
MessageSnapshot processing failed
What happenedA snapshot was still processing after the CLI waited about five minutes for it.
What to doRun the command again. If it happens again, contact support.
Also seen asSnapshot Failed, when processing finished with a failure

Local Server and Network

SmartUI server setup failed

FieldValue
MessageSmartUI server setup failed
What happenedThe local SmartUI server that receives SDK snapshots could not start. The reason is printed just above the message.
What to doFix the problem it names, then run the command again.

No available ports found in range

FieldValue
MessageNo available ports found in range …
What happenedEvery port in the range the CLI tried for its local server was in use.
What to doFree a port in the range shown in the message, then run the command again.

Invalid port number. Port number must be an integer between 1 and 65535.

FieldValue
MessageInvalid port number. Port number must be an integer between 1 and 65535.
What happenedThe value passed to --port is not a valid port.
What to doPass a whole number from 1 to 65535.

Invalid proxy URL

FieldValue
MessageInvalid proxy URL:
What happenedThe value of the SMARTUI_API_PROXY environment variable could not be read as a URL.
What to doSet SMARTUI_API_PROXY to a proxy address such as proxy.example.com:8080, or to a full URL that starts with http.

Merging Builds and Branches

Merging two similar build is not possible

FieldValue
MessageMerging two similar build is not possible
What happenedThe source and target of the merge are the same build.
What to doChoose two different builds.

Merging two similar branch is not possible

FieldValue
MessageMerging two similar branch is not possible
What happenedThe source and target of the merge are the same branch.
What to doChoose two different branches. See Branching Strategy.

Error: The --source option cannot be empty.

FieldValue
MessageError: The --source option cannot be empty.
What happenedA merge was started without a source.
What to doPass both --source and --target.
Also seen asError: The --target option cannot be empty.

Merging SmartUI build failed

FieldValue
MessageMerging SmartUI build failed
What happenedThe merge did not complete. The reason is printed just above the message.
What to doFix the problem it names, then run the merge again.
Also seen asError while initiating merging process: … · Error while fetching buildInfo: … · Error while fetching branch Info: …

Figma

Errors about the Figma token and about Figma config validation are documented on the SmartUI Figma App CLI page: see Understanding the Tokens and Credentials and The config file is rejected.

Missing LT_USERNAME in Environment Variables

FieldValue
MessageMissing LT_USERNAME in Environment Variables
What happenedA Figma command found LT_USERNAME set to an empty value.
What to doSet it to your username, or leave it unset. See Understanding the Tokens and Credentials.
Also seen asMissing LT_ACCESS_KEY in Environment Variables, the same check for LT_ACCESS_KEY

No Figma configuration found in config file

FieldValue
MessageNo Figma configuration found in config file
What happenedA Figma command ran against a config file with no Figma section.
What to doAdd the Figma configuration to your config file. See SmartUI Figma CLI.

Mismatch in Figma Ids and Screenshot Viewports in figma config

FieldValue
MessageMismatch in Figma Ids and Screenshot Viewports in figma config
What happenedThe number of Figma IDs does not match the number of screenshot viewports.
What to doGive every Figma ID a matching viewport.

Uploading Figma designs failed

FieldValue
MessageUploading Figma designs failed
What happenedThe Figma designs could not be uploaded.
What to doRun the command again. If it happens again, contact support.
Also seen asUploading Web Figma Screenshots failed · Uploading App Figma Screenshots failed

Timeout: Fetching figma results took more than 5 minutes.

FieldValue
MessageTimeout: Fetching figma results took more than 5 minutes.
What happenedThe CLI stopped waiting for Figma comparison results.
What to doRun the command again.
Also seen asStopping execution after 5 minutes.

SDK

contextId and snapshotName are required parameters

FieldValue
MessagecontextId and snapshotName are required parameters
What happenedA snapshot request reached the CLI without a contextId or a snapshotName.
What to doSend both values with every snapshot request.

No buildId found for contextId

FieldValue
MessageNo buildId found for contextId: …
What happenedA snapshot finished processing, but no build was linked to it.
What to doRun the command again. If it happens again, contact support.

Page instance not available

FieldValue
MessagePage instance not available
What happenedThe CLI tried to run a page script, but its browser page was not available.
What to doRun the command again. If it happens again, contact support.

Getting Additional Help

If you encounter issues not covered in this guide:

  1. Check Related Documentation:

  2. Search Existing Issues:

  3. Contact Support:

  4. Provide Diagnostic Information:

    • CLI version: npx smartui --version
    • Configuration file (redact sensitive data)
    • Error messages and logs
    • Steps to reproduce

Additional Resources

Test across 3000+ combinations of browsers, real devices & OS.

×
Schedule Your Personal Demo
Book Demo

Help and Support

Related Articles