Skip to content

Inconsistent outcomes when resolving directories with special characters #17457

Closed
@zisiszak

Description

@zisiszak

Describe the bug

I kept getting a failed to load config error on an old, archived repo. This repo was nested within a parent directory named old?, whose question mark turned out to be the cause of the error. Only problem is the error is not descriptive, even though a parent directory of old# does alert you that a hash might cause issues.

Renaming the parent directory is an easy fix, and so having a clear error/warning logged suggesting so would help add to an even better dev experience.

I only found three characters that caused that kind of behaviour: ?*\

Reproduction

https://github.com/zisiszak/vite-inconsistent-resolution-error-logging

Steps to reproduce

  1. Run cd old\?
  2. Run pnpm install (or whatever suits)
  3. Run pnpm test (shortcut for pnpm exec vite)

From there, cd into the old# dir and repeat for an example of expected behaviour.

System Info

System:
    OS: macOS 14.5
    CPU: (10) arm64 Apple M1 Max
    Memory: 1.78 GB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.13.1 - ~/.nvm/versions/node/v20.13.1/bin/node
    Yarn: 1.22.22 - ~/.nvm/versions/node/v20.13.1/bin/yarn
    npm: 10.5.2 - ~/.nvm/versions/node/v20.13.1/bin/npm
    pnpm: 9.1.1 - ~/Library/pnpm/pnpm
  Browsers:
    Brave Browser: 125.1.66.118
    Safari: 17.5
  npmPackages:
    vite: ^5.2.13 => 5.2.13

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

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions