Skip to content

. behaves differently from nodejs in Windows (and seemingly wrong) #24748

@pcarrier

Description

@pcarrier

What version of Bun is running?

1.3.2+b131639cc

What platform is your computer?

Microsoft Windows NT 10.0.26100.0 x64

What steps can reproduce the bug?

Run this script in bun:

PS C:\Users\pierr\Documents\charles11c> bun test.js
{
  cwd: "C:\\Users\\pierr\\Documents\\charles11c",
  "existsSync('./')": false,
  "existSync('.')": false,
  "existsSync(process.cwd())": true,
  statSync: true,
}
PS C:\Users\pierr\Documents\charles11c> cat test.js
const fs = require("fs");
console.log({
  cwd: process.cwd(),
  "existsSync('./')": fs.existsSync("./"),
  "existSync('.')": fs.existsSync("."),
  "existsSync(process.cwd())": fs.existsSync(process.cwd()),
  statSync: fs.statSync("./").isDirectory(),
});

What is the expected behavior?

Only true.

What do you see instead?

{
  cwd: "C:\\Users\\pierr\\Documents\\charles11c",
  "existsSync('./')": false,
  "existSync('.')": false,
  "existsSync(process.cwd())": true,
  statSync: true,
}

Additional information

This breaks globbing in 11ty.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions