Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Use Cloudflare Workers RPC #20

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft

Conversation

naporin0624
Copy link
Member

@naporin0624 naporin0624 commented Apr 8, 2024

closed: #19

memo

PRC can communicate with workers and Durable Objects via serializable objects, but Response, including WebScoket, is not considered Serializable, so miniflare does not work.
The same thing happens with v8 isolated.

✘ [ERROR] DOMException {
workers:dev: 
workers:dev:     stack: 'Error: Could not serialize object of type "WebSocket". This type does not support
workers:dev:   serialization.\n' +
workers:dev:       '    at null.<anonymous> (async
workers:dev:   file://[masked]/index.js:9652:35)\n' +
workers:dev:       '    at async dispatch
workers:dev:   (file://[masked]/compose.js:29:17)\n' +
workers:dev:       '    at async dispatch
workers:dev:   (file://[masked]/compose.js:29:17)\n' +
workers:dev:       '    at async cors2
workers:dev:   (file://[masked]/cors/index.js:65:5)\n' +
workers:dev:       '    at async dispatch
workers:dev:   (file://[masked]/compose.js:29:17)\n' +
workers:dev:       '    at null.<anonymous> (async
workers:dev:   file://[masked]/index.js:1006:25)\n' +
workers:dev:       '    at async jsonError
workers:dev:   (file://[masked]/json-error.ts:22:10)\n' +
workers:dev:       '    at async drainBody
workers:dev:   (file://[masked]/middleware-ensure-req-body-drained.ts:5:10)',
workers:dev:     code: 25,
workers:dev:     name: 'DataCloneError',
workers:dev:     message: 'Could not serialize object of type "WebSocket". This type does not support
workers:dev:   serialization.'
workers:dev:   }

Copy link

changeset-bot bot commented Apr 8, 2024

⚠️ No Changeset found

Latest commit: 6a7c705

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

cloudflare-pages bot commented Apr 8, 2024

Deploying yjs-worker with  Cloudflare Pages  Cloudflare Pages

Latest commit: 6a7c705
Status: ✅  Deploy successful!
Preview URL: https://b3ce32d1.yjs-worker.pages.dev
Branch Preview URL: https://feat-worker-rpc.yjs-worker.pages.dev

View logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

support JavaScript-native RPC
1 participant