Skip to content

pnpm create astro fails silently on Linux when path contains non-ASCII characters (Unicode NFC vs NFD normalization bug) #17381

Description

@kcabdussamed

Astro Info

Astro v4.x (Latest via pnpm create astro@latest)
OS: Manjaro Linux (Kernel v6.x)
Package Manager: pnpm v11.13.0
Shell: zsh

If this issue only occurs in one browser, which browser is a problem?

Not a browser issue. It occurs during the CLI scaffolding process in the terminal.

Describe the Bug

When running pnpm create astro@latest inside a directory path that contains non-ASCII/Unicode characters (e.g., Turkish characters like ü in /home/saqut/Masaüstü/), the installation script finishes with a successful exit code ("Project initialized!"), but the target directory remains empty except for root monorepo files. The src/ folder, package.json, and astro.config.mjs are missing.

By tracing the system calls using strace, we uncovered that the scaffolding tool uses NFD (Decomposed Unicode) format for path names, while Linux (ext4) expects NFC (Canonical Decomposition).

As seen in the strace log below, Node/Astro tries to resolve the path using NFD components (Masau\314\210stu\314\210 instead of Masaüstü):

Image
86653 openat(AT_FDCWD, "/home/saqut/Masau\314\210stu\314\210/saqutcompiler/webside/deneme/astro.config.mjs", O_WRONLY|O_CREAT|O_TRUNC|O_NOFOLLOW|O_CLOEXEC, 0664) = 31
86656 openat(AT_FDCWD, "/home/saqut/Masau\314\210stu\314\210/saqutcompiler/webside/deneme/package.json", O_WRONLY|O_CREAT|O_TRUNC|O_NOFOLLOW|O_CLOEXEC, 0664) = 32

### What's the expected result?

The installer should sanitize, normalize, or preserve the exact Unicode normalization form (NFC) used by the host OS filesystem, ensuring that files like package.json and the src/ directory are successfully written to the correct physical path.

### Link to Minimal Reproducible Example

https://github.com/withastro/astro#NFC-NFD-Unicode-Path-Bug

### Participation

- [ ] I am willing to submit a pull request for this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    - P4: importantViolate documented behavior or significantly impacts performance (priority)pkg: create-astroRelated to the `create-astro` package (scope)triage: fix pendingReporter needs to verify the triage bot fix works

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions