kleinpetr
Explore posts from serversCDCloudflare Developers
•Created by kleinpetr on 4/29/2025 in #workers-help
Support for Custom Serialization in Queues (e.g. `superjson`)
Hi everyone,
I’d like to propose or ask about native support for custom serialization and deserialization logic when working with Cloudflare Queues.
In our current use case, we deal with objects that include Date instances and other complex structures. We’d like to use SuperJSON (or a similar tool) as our default serializer because it handles these cases much more gracefully than JSON.stringify.
The problem is that, at the moment, we have to manually call
superjson.stringify
every time we push data to the queue, and then manually parse it again with superjson.parse
when we pull messages. This results in repetitive code scattered throughout the application, especially when iterating over messages during batch processing.
Moreover, when we manually use SuperJSON.stringify, the result is stored in the queue as a string — not as a structured JSON object.
Feature request / question: Would it be possible to allow registration of a global (or per-queue) custom serialize() / deserialize() function pair? These would be automatically applied on enqueue/dequeue operations.
This would significantly reduce boilerplate and improve developer ergonomics.
Thanks for considering this! Curious if others have encountered similar pain points or found better workarounds.5 replies
How to polyfill buffer when using web3 Solana connector
Hi,
I am facing a build issue when I try to build for cloudflare_pages
here is minimal reproduction https://stackblitz.com/github/kleinpetr/nuxt-solana
I was trying to enable experimental clientNodeCompat: true but it didn't help
I was trying to polyfill node by this example https://stackoverflow.com/questions/77903800/vite-solana-wallet-adapter but it also didn't help
I wouldn't need to know how I could get more details and how to think about the polyfilling.
Thanks for your ideas 🙏
5 replies
CDCloudflare Developers
•Created by kleinpetr on 4/12/2023 in #pages-help
postinstall script is triggered too soon
Hi I am facing an issue with deploying Nuxt to Cloudflare Pages via Nitro preset.
It looks that during the build, Cloudflare trigger another job called "Installing dependencies" immediately when repo is cloned, but then it triggers my
postinstall
script which call nuxt prepare
and it looks that not all deps are already installed at this moment so I am getting an error, especially with Pinia
[error] Cannot find module 'pinia/dist/pinia.mjs'
In my build command I'set install explicitly pnpm i && pnpm build
so how can I prevent to trigger postinstall
before my build command is called?4 replies