Workspace glob patterns fail in deno-loader/deno-resolver esbuild plugins

Open
#3,805 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
deno, typescript
Domain
build-system

Research direction

Start by locating Fresh’s deno-loader and deno-resolver esbuild plugins and trace how each resolves workspace members from deno.json. Compare that path with Deno’s collect_member_config_folders implementation in workspace/discovery.rs, which the issue identifies as handling globs. Done when both plugins expand workspace globs and the provided reproduction builds successfully.

Written by the indexing model from the issue text.

Description

bug upstream

Summary

When the root deno.json uses a glob pattern (e.g. "./src/*") in the workspace array, Fresh's build process fails with WorkspaceDiscoverError(ResolveMember(NotFound)). The glob is not expanded and is instead treated as a literal path (/src/*/), causing the error.

This originates from the deno-loader and deno-resolver esbuild plugins used by Fresh — not from Deno core. Deno's own workspace resolution (deno_config crate) handles globs correctly via collect_member_config_folders in workspace/discovery.rs, but the esbuild plugins appear to use a version of deno_config that predates glob support, or a code path that doesn't invoke glob expansion.

Reproduction

From denoland/deno#28906:

  1. Use a workspace config with globs:
    { "workspace": ["./src/*"] }
    
  2. Run a Fresh app via createHandler from the workspace root
  3. Build fails with:
    ✘ [ERROR] WorkspaceDiscoverError(ResolveMember(NotFound { dir_url: ... /src/*/ })) [plugin deno-loader]
    ✘ [ERROR] WorkspaceDiscoverError(ResolveMember(NotFound { dir_url: ... /src/*/ })) [plugin deno-resolver]
    

Workaround: list workspace members explicitly instead of using globs.

Minimal repro repo: https://github.com/StaytunedLLP/open_poc/blob/main/src/deno_workspace_fresh/

Expected behavior

The esbuild plugins should expand workspace glob patterns the same way Deno core does, or use a deno_config version that supports them.

Dominant language
TypeScript
Stars
13.8k
Forks
757
Avg merge
3m
Merged PRs (30d)
2

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from freshframework/fresh

All issues in freshframework/fresh

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.