Skip to content

[wrangler] Can't override default module rules using fallthrough = false #14257

Description

@sgentle

What versions & operating system are you using?

  System:
    OS: macOS 15.7.7
    CPU: (10) arm64 Apple M1 Max
    Memory: 7.28 GB / 64.00 GB
    Shell: 3.6.1 - /opt/homebrew/bin/fish
  Binaries:
    Node: 24.14.1 - /opt/homebrew/bin/node
    npm: 11.11.0 - /usr/local/bin/npm
  npmPackages:
    wrangler: ^4.99.0 => 4.99.0

Please provide a link to a minimal reproduction

https://github.com/sgentle/wrangler-modules-fallback-repro

Describe the Bug

I'm finding the behaviour of module rules and fallthrough = false very confusing... as far as I can tell, there's no way to tell wrangler not to include a module that it would otherwise include. In the linked repro, when I run npx wrangler dev I get:

✘ [ERROR] The file html/dontincludeme.html matched a module rule in your configuration ({"type":"Text","globs":["**/*.txt","**/*.html","**/*.sql"]}), but was ignored because a previous rule with the same type was not marked as `fallthrough = true`.

If that's unintentional, then I suppose this is a bug. If it is intentional, then I'm not sure what the purpose of the fallthrough flag is, since it seems like any value other than true can only be used in circumstances where it's effectively a no-op.

At the very least, it seems like something worth documenting (ie: if you're using no_bundle/find_additional_modules, any .txt/.html/.sql/.bin/.wasm file in a subdirectory of base_dir (but not in base_dir itself) must not be matched by a fallthrough = false rule and must be uploaded).

Please provide any relevant error logs

No response

Metadata

Metadata

Assignees

Labels

package:wranglerRelating to the `wrangler` package

Type

No fields configured for Bug.

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions