Skip to content

Bug: pnpm test fails on Windows #10868

@FAL-coffee

Description

@FAL-coffee

Problem

Running pnpm test on Windows fails for multiple packages.

Steps to Reproduce

  1. Clone the repository on Windows
  2. Run pnpm install
  3. Run pnpm test

Errors

packages/tar-parser

ENOENT: no such file or directory, stat 'D:\D:\workspace\remix\packages\tar-parser\test\fixtures\express-4.21.1.tgz'

All 20 tests fail (duplicated drive letter: D:\D:\...)

packages/mime

compressible-mime-types.ts does not match expected output.
+ '// DO NOT EDIT. THIS IS GENERATED CODE.\r\n'
- '// DO NOT EDIT. THIS IS GENERATED CODE.\n'

2 tests fail (line ending mismatch: CRLF vs LF)

packages/interaction

Error: browserType.launch: Executable doesn't exist at C:\Users\...\ms-playwright\chromium_headless_shell-1194\chrome-win\headless_shell.exe

Playwright browsers not installed

Suspected Root Cause

The following files use new URL(import.meta.url).pathname, which doesn't handle Windows paths correctly:

  • packages/tar-parser/test/utils.ts (line 4)
  • scripts/utils/packages.js (line 4)
  • packages/node-fetch-server/demos/http2/server.js (line 6)
  • packages/static-middleware/demos/list-files/server.js (line 7)

On Windows, new URL(import.meta.url).pathname returns paths like /D:/workspace/..., which when combined with path.dirname() or path.resolve(), results in duplicated drive letters like D:\D:\workspace\....

Environment

  • OS: Windows
  • Node.js: (version TBD)
  • pnpm: (version TBD)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions