Improve error message when the assets directory path points to a file instead of a directory#13115
Conversation
… instead of a directory
🦋 Changeset detectedLatest commit: 5d38f9e The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Codeowners approval required for this PR:
Show detailed file reviewers |
|
✅ All changesets look good |
|
I've now reviewed the entire PR. Let me check the error message wording closely:
But looking at the test expectations more carefully:
The wording is consistent between tests and source. The existing error says "directory specified by" while the new one says "path specified by" — this is appropriate since in the new case it's not a directory. Let me now verify the behavior at the The overall change is clean:
LGTM |
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
wrangler
commit: |
… instead of a directory (#13115)
If users mistakenly specify a path pointing to a file for assets they receive an unpolished/slightly confusing error message like so:
This PR simply improves this error message so that we clearly tell the user what the issue is:
Example:
A picture of a cute animal (not mandatory, but encouraged)