Commit d123ad0
Error gracefully when encountering date values in TOML config files (#11651)
* fix: automatically convert TOML Date values in vars to strings
TOML parses unquoted date values like DATE = 2024-01-01 as Date objects.
Previously this caused a confusing error from Miniflare. Now wrangler
automatically converts Date values to ISO date strings (YYYY-MM-DD format)
and shows a warning suggesting to wrap the value in quotes.
Co-authored-by: Dario Piotrowicz <dario@cloudflare.com>
* error insted of trying to convert to string
* Apply suggestions from code review
Co-authored-by: Victor Berchet <victor@suumit.com>
* Apply suggestions from code review
Co-authored-by: Victor Berchet <victor@suumit.com>
* Apply suggestions from code review
* use hardcoded example
* create toml dates using smol-toml in tests
---------
Co-authored-by: OpenCode Claude <opencode-claude@anthropic.com>
Co-authored-by: Victor Berchet <victor@suumit.com>1 parent eac5cf7 commit d123ad0
File tree
4 files changed
+80
-3
lines changed- .changeset
- packages/workers-utils
- src/config
- tests/config/validation
4 files changed
+80
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2069 | 2069 | | |
2070 | 2070 | | |
2071 | 2071 | | |
2072 | | - | |
2073 | | - | |
2074 | | - | |
| 2072 | + | |
| 2073 | + | |
| 2074 | + | |
2075 | 2075 | | |
2076 | 2076 | | |
2077 | 2077 | | |
| |||
2080 | 2080 | | |
2081 | 2081 | | |
2082 | 2082 | | |
| 2083 | + | |
| 2084 | + | |
| 2085 | + | |
| 2086 | + | |
| 2087 | + | |
| 2088 | + | |
| 2089 | + | |
| 2090 | + | |
| 2091 | + | |
| 2092 | + | |
| 2093 | + | |
| 2094 | + | |
| 2095 | + | |
| 2096 | + | |
| 2097 | + | |
| 2098 | + | |
| 2099 | + | |
2083 | 2100 | | |
2084 | 2101 | | |
2085 | 2102 | | |
| |||
Lines changed: 46 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
5469 | 5470 | | |
5470 | 5471 | | |
5471 | 5472 | | |
| 5473 | + | |
| 5474 | + | |
| 5475 | + | |
| 5476 | + | |
| 5477 | + | |
| 5478 | + | |
| 5479 | + | |
| 5480 | + | |
| 5481 | + | |
| 5482 | + | |
| 5483 | + | |
| 5484 | + | |
| 5485 | + | |
| 5486 | + | |
| 5487 | + | |
| 5488 | + | |
| 5489 | + | |
| 5490 | + | |
| 5491 | + | |
| 5492 | + | |
| 5493 | + | |
| 5494 | + | |
| 5495 | + | |
| 5496 | + | |
| 5497 | + | |
| 5498 | + | |
| 5499 | + | |
| 5500 | + | |
| 5501 | + | |
| 5502 | + | |
| 5503 | + | |
| 5504 | + | |
| 5505 | + | |
| 5506 | + | |
| 5507 | + | |
| 5508 | + | |
| 5509 | + | |
| 5510 | + | |
| 5511 | + | |
| 5512 | + | |
| 5513 | + | |
| 5514 | + | |
| 5515 | + | |
| 5516 | + | |
| 5517 | + | |
5472 | 5518 | | |
5473 | 5519 | | |
5474 | 5520 | | |
| |||
0 commit comments