Zod iso datetime parsing error #109

Closed
opened 2025-08-02 14:50:03 +08:00 by squid · 0 comments
Owner
  • FE server side log:

    ZodError: [
      {
        "origin": "string",
        "code": "invalid_format",
        "format": "datetime",
        "pattern": "/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/",
        "path": [
          "published_time"
        ],
        "message": "Invalid ISO datetime"
      }
    ]
        at fromJson (file:///app/build/server/chunks/postApiServiceImpl-BFuoRzkf.js:11634:47)
        at Array.map (<anonymous>)
        at PostApiServiceImpl.getAllPosts (file:///app/build/server/chunks/postApiServiceImpl-BFuoRzkf.js:11706:17)
        at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
        at async PostRepositoryImpl.getAllPosts (file:///app/build/server/chunks/postApiServiceImpl-BFuoRzkf.js:11496:18)
        at async PostListBloc.loadPosts (file:///app/build/server/chunks/postListBloc-Bix43zXS.js:26:19)
        at async load (file:///app/build/server/chunks/3-CsiDlmOg.js:8:17)
        at async load_server_data (file:///app/build/server/index.js:1666:18)
        at async file:///app/build/server/index.js:3365:18
    

image.png

- FE server side log: ``` ZodError: [ { "origin": "string", "code": "invalid_format", "format": "datetime", "pattern": "/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/", "path": [ "published_time" ], "message": "Invalid ISO datetime" } ] at fromJson (file:///app/build/server/chunks/postApiServiceImpl-BFuoRzkf.js:11634:47) at Array.map (<anonymous>) at PostApiServiceImpl.getAllPosts (file:///app/build/server/chunks/postApiServiceImpl-BFuoRzkf.js:11706:17) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async PostRepositoryImpl.getAllPosts (file:///app/build/server/chunks/postApiServiceImpl-BFuoRzkf.js:11496:18) at async PostListBloc.loadPosts (file:///app/build/server/chunks/postListBloc-Bix43zXS.js:26:19) at async load (file:///app/build/server/chunks/3-CsiDlmOg.js:8:17) at async load_server_data (file:///app/build/server/index.js:1666:18) at async file:///app/build/server/index.js:3365:18 ``` ![image.png](/attachments/2555ef47-8156-4cc8-a227-15e58c875917)
457 KiB
squid added the
invalid
dev
frontend
labels 2025-08-02 14:50:03 +08:00
squid added this to the Pre-release Development Plan project 2025-08-02 14:50:03 +08:00
squid moved this to In Progress in Pre-release Development Plan on 2025-08-02 14:50:06 +08:00
squid added this to the 0.3 milestone 2025-08-02 14:52:26 +08:00
squid added reference BLOG-109_fix_zod_iso_datetime_parsing_error 2025-08-02 14:52:28 +08:00
squid closed this issue 2025-08-02 14:55:45 +08:00
squid moved this to Done in Pre-release Development Plan on 2025-08-02 15:04:12 +08:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: squid/blog#109
No description provided.