Skip to content

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

@bartlomieju

Description

@bartlomieju

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working.upstreamThe issue is with an upstream dependency.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions