What versions & operating system are you using?
wrangler 4.75.0
pyodide-3.13.2-emscripten-wasm32-musl
Please provide a link to a minimal reproduction
no
Describe the Bug
Python Worker deployments that were working fine suddenly started failing with no code changes on our end.
On 2026-03-18, deployments were successful until around 08:00 UTC. After that, the exact same code began failing with a serialization error during deploy.
Steps to reproduce
Run the same deploy command that was working before:
pywrangler deploy --env production
Expected behavior
Deploys successfully, as it did earlier the same day.
Actual behavior
Deploy fails with the following error: (see below)
Additional context
- No code changes were made between the working and failing deploys
Please provide any relevant error logs
✘ [ERROR] A request to the Cloudflare API (/accounts/[MASKED]/workers/scripts/api-router-3/versions) failed.
Uncaught Error: Can't serialize top-level variable.
Please review any global variables you or your imported modules create at the top-level of your code, and consider deleting them.
Description of the value:
Value: function () { [native code] }
Type: function
Constructor name: Function
toStringTag: [object Function]
at null.<anonymous> (pyodide-internal:snapshot:418:12) in createUnserializableObjectError
at null.<anonymous> (pyodide-internal:snapshot:438:15) in serializer
at null.<anonymous> (pyodide-internal:generated/emscriptenSetup:24266:23) in API.serializeHiwireState
at null.<anonymous> (pyodide-internal:snapshot:465:29) in makeLinearMemorySnapshot
at null.<anonymous> (pyodide-internal:snapshot:611:22) in collectSnapshot
at null.<anonymous> (pyodide-internal:snapshot:646:5) in maybeCollectDedicatedSnapshot
at null.<anonymous> (pyodide:python-entrypoint-helper:413:5) in initPython
[code: 10021]
To learn more about this error, visit: https://developers.cloudflare.com/workers/observability/errors/#validation-errors-10021
If you think this is a bug, please open an issue at: https://github.com/cloudflare/workers-sdk/issues/new/choose
🪵 Logs were written to "/root/.config/.wrangler/logs/wrangler-2026-03-19_00-59-27_575.log"
Cleaning up project directory and file based variables
00:01
ERROR: Job failed: exit code 1
What versions & operating system are you using?
wrangler 4.75.0
pyodide-3.13.2-emscripten-wasm32-musl
Please provide a link to a minimal reproduction
no
Describe the Bug
Python Worker deployments that were working fine suddenly started failing with no code changes on our end.
On 2026-03-18, deployments were successful until around 08:00 UTC. After that, the exact same code began failing with a serialization error during deploy.
Steps to reproduce
Run the same deploy command that was working before:
Expected behavior
Deploys successfully, as it did earlier the same day.
Actual behavior
Deploy fails with the following error: (see below)
Additional context
Please provide any relevant error logs
✘ [ERROR] A request to the Cloudflare API (/accounts/[MASKED]/workers/scripts/api-router-3/versions) failed.
Uncaught Error: Can't serialize top-level variable.
Please review any global variables you or your imported modules create at the top-level of your code, and consider deleting them.
Description of the value:
Value: function () { [native code] }
Type: function
Constructor name: Function
toStringTag: [object Function]
[code: 10021]
To learn more about this error, visit: https://developers.cloudflare.com/workers/observability/errors/#validation-errors-10021
If you think this is a bug, please open an issue at: https://github.com/cloudflare/workers-sdk/issues/new/choose
🪵 Logs were written to "/root/.config/.wrangler/logs/wrangler-2026-03-19_00-59-27_575.log"
Cleaning up project directory and file based variables
00:01
ERROR: Job failed: exit code 1