Skip to content

ssr.noExternal and environments.ssr.resolve.noExternal are not merged correctly #20499

@jamesopstad

Description

@jamesopstad

Describe the bug

If either ssr.noExternal or environments.ssr.resolve.noExternal are set to true then other values should be ignored and both should be resolved to true in the config. They are currently incorrectly merged to an array e.g. ['some-dep', true].

Reproduction

https://github.com/jamesopstad/vite-ssr-no-external-repro

Steps to reproduce

Run pnpm i followed by pnpm dev. Inspect vite.config.ts and logged output.

System Info

System:
    OS: macOS 15.5
    CPU: (12) arm64 Apple M3 Pro
    Memory: 258.20 MB / 36.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 24.2.0 - ~/.nvm/versions/node/v24.2.0/bin/node
    Yarn: 1.22.22 - ~/.nvm/versions/node/v24.2.0/bin/yarn
    npm: 11.3.0 - ~/.nvm/versions/node/v24.2.0/bin/npm
    pnpm: 10.12.4 - ~/.nvm/versions/node/v24.2.0/bin/pnpm
  Browsers:
    Chrome: 138.0.7204.169
    Safari: 18.5

Used Package Manager

pnpm

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    p3-minor-bugAn edge case that only affects very specific usage (priority)

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions