Tobias Lundin
Tobias Lundin•3h ago

Node compat for `matchesGlob` from `node:path`?

Hi there šŸ‘‹ I'm new here but have been a deno fan from the get-go and have several project running on deno deploy v1 and v2 - love it!
I'm using deno 2.5.2 locally
Right now I'm attempting to deploy a tanstack-start app using the Nitro adapter (nightly v3 version) - https://nitro.build/deploy/providers/deno-deploy - https://tanstack.com/start/latest/docs/framework/react/hosting But using that I cant even build and this is the error I get:
deno task build
Task build vite build
error during build:
SyntaxError: The requested module 'node:path' does not provide an export named 'matchesGlob' at file:///Users/tobias/dev/tolu/tanstack-start-deno/node_modules/.deno/unstorage@2.0.0-alpha.3/node_modules/unstorage/dist/drivers/fs.mjs:2:35
at async createStorage (file:///Users/tobias/dev/tolu/tanstack-start-deno/node_modules/.deno/nitro-nightly@3.0.0-20251010-091540-0e3dbc69/node_modules/nitro-nightly/dist/_chunks/index.mjs:20195:22)
deno task build
Task build vite build
error during build:
SyntaxError: The requested module 'node:path' does not provide an export named 'matchesGlob' at file:///Users/tobias/dev/tolu/tanstack-start-deno/node_modules/.deno/unstorage@2.0.0-alpha.3/node_modules/unstorage/dist/drivers/fs.mjs:2:35
at async createStorage (file:///Users/tobias/dev/tolu/tanstack-start-deno/node_modules/.deno/nitro-nightly@3.0.0-20251010-091540-0e3dbc69/node_modules/nitro-nightly/dist/_chunks/index.mjs:20195:22)
I've simplified the issue to this code, and I dont really understand why this should not work?
import { matchesGlob } from 'node:path';
console.log(matchesGlob(Deno.cwd(), '**/*.json'));
import { matchesGlob } from 'node:path';
console.log(matchesGlob(Deno.cwd(), '**/*.json'));
terminal output:
āÆ deno run ./deno-test.ts
error: Uncaught SyntaxError: The requested module 'node:path' does not provide an export named 'matchesGlob'
import { matchesGlob } from 'node:path';
āÆ deno run ./deno-test.ts
error: Uncaught SyntaxError: The requested module 'node:path' does not provide an export named 'matchesGlob'
import { matchesGlob } from 'node:path';
What am I doing wrong here? Help very much appreciated! šŸ™šŸ™šŸ™
Deno Deploy - Nitro
Deploy Nitro apps to Deno Deploy.
Hosting | TanStack Start React Docs
Hosting is the process of deploying your application to the internet so that users can access it. This is a critical part of any web development project, ensuring your application is available to the...
1 Reply
fry69
fry69•2h ago
I rewrote and expanded your test case a bit so it works in Node (24+) and should work Deno (fails of course as shown above):
import { matchesGlob } from "node:path";
import { readdirSync } from "node:fs";
import { join } from "node:path";
import process from "node:process";

const cwd = process.cwd();
const files = readdirSync(cwd);

console.log(`Testing matchesGlob() for files in: ${cwd}\n`);

files.forEach((file) => {
const fullPath = join(cwd, file);
const matches = matchesGlob(fullPath, "**/*.json");
console.log(`${file}: ${matches}`);
});
import { matchesGlob } from "node:path";
import { readdirSync } from "node:fs";
import { join } from "node:path";
import process from "node:process";

const cwd = process.cwd();
const files = readdirSync(cwd);

console.log(`Testing matchesGlob() for files in: ${cwd}\n`);

files.forEach((file) => {
const fullPath = join(cwd, file);
const matches = matchesGlob(fullPath, "**/*.json");
console.log(`${file}: ${matches}`);
});
Node output:
$ node main.ts
Testing matchesGlob() for files in: /node-matchesGlob

.git: false
deno.json: true
deno.lock: false
main.ts: false
$ node main.ts
Testing matchesGlob() for files in: /node-matchesGlob

.git: false
deno.json: true
deno.lock: false
main.ts: false
Deno stays the same:
$ deno fmt --check && deno lint && deno check
Checked 2 files
Checked 1 file
Check file:///node-matchesGlob/main.ts

$ deno main.ts
error: Uncaught SyntaxError: The requested module 'node:path' does not provide an export named 'matchesGlob'
import { matchesGlob } from 'node:path';
^
at <anonymous> (file:///node-matchesGlob/main.ts:1:10)
$ deno fmt --check && deno lint && deno check
Checked 2 files
Checked 1 file
Check file:///node-matchesGlob/main.ts

$ deno main.ts
error: Uncaught SyntaxError: The requested module 'node:path' does not provide an export named 'matchesGlob'
import { matchesGlob } from 'node:path';
^
at <anonymous> (file:///node-matchesGlob/main.ts:1:10)
I'd recommend to open an issue for this. Interesting, there is -> https://docs.deno.com/api/node/path/~/path.PlatformPath.matchesGlob But that seems only to exist as a type?
$ deno fmt --check && deno lint && deno check
Checked 2 files
Checked 1 file
Check file:///node-matchesGlob/main.ts
TS2693 [ERROR]: 'PlatformPath' only refers to a type, but is being used as a value here.
const matches = PlatformPath.matchesGlob(fullPath, "**/*.json");
~~~~~~~~~~~~
at file:///node-matchesGlob/main.ts:13:19

error: Type checking failed.
$ deno fmt --check && deno lint && deno check
Checked 2 files
Checked 1 file
Check file:///node-matchesGlob/main.ts
TS2693 [ERROR]: 'PlatformPath' only refers to a type, but is being used as a value here.
const matches = PlatformPath.matchesGlob(fullPath, "**/*.json");
~~~~~~~~~~~~
at file:///node-matchesGlob/main.ts:13:19

error: Type checking failed.

Did you find this page helpful?