We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi, I tried run y-sweet server in local with folloing docker-compose.yml
docker-compose.yml
ysweet: image: y-sweet container_name: ysweet network_mode: host volumes: - /..../data:/data ports: - "8092:8092" command: y-sweet serve /data --url-prefix=http://0.0.0.0:8092 --port 8092 --host 0.0.0.0
but when i tried getDocAsUpdate in my Next.js /doc/_docId_/route.ts:
getDocAsUpdate
/doc/_docId_/route.ts
import { DocumentManager } from '@y-sweet/sdk'; import { NextResponse } from 'next/server' import * as Y from 'yjs' // Define the interface for URL parameters interface Params { docId: string; } const manager = new DocumentManager("ys://0.0.0.0:8092"); export async function GET(request: Request, { params }: { params: Params } // Type the context with Params ) { try { // Extract query parameters from the URL const { docId } = params; // Extract params let update = await manager.getDocAsUpdate(docId || "") return NextResponse.json(update) /* doc.transact(() => { Y.applyUpdate(doc, update) }) */ } catch (error) { console.error('Error processing request:', error); } }
I got the error message:
nextjs | Error processing request: e [YSweetError]: ServerError: Server responded with 404 Not Found. URL: http://0.0.0.0:8092//d/a7b6b050-995d-4204-a5d0-51fe6582d62e/as-update?z=s0hd13w9i1 nextjs | at o.request (/app/.next/server/chunks/91.js:12:16934) nextjs | at process.processTicksAndRejections (node:internal/process/task_queues:95:5) nextjs | at async n.getAsUpdate (/app/.next/server/chunks/91.js:12:17153) nextjs | at async s.getDocAsUpdate (/app/.next/server/chunks/91.js:12:18383) nextjs | at async c (/app/.next/server/app/relay/[relayId]/doc/[docId]/as-update/route.js:1:633) nextjs | at async /app/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:34666 nextjs | at async eS.execute (/app/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:25813) nextjs | at async eS.handle (/app/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:35920) nextjs | at async doRender (/app/node_modules/next/dist/server/base-server.js:1377:42) nextjs | at async cacheEntry.responseCache.get.routeKind (/app/node_modules/next/dist/server/base-server.js:1599:28) { nextjs | cause: { nextjs | code: 'ServerError', nextjs | status: 404, nextjs | message: 'Not Found', nextjs | url: 'http://0.0.0.0:8092//d/a7b6b050-995d-4204-a5d0-51fe6582d62e/as-update?z=s0hd13w9i1' nextjs | } nextjs | }
I found that the url http://0.0.0.0:8092//d/a7b6b... looks wired, so i edit the craftes/y-sweet/src/server.rs as
http://0.0.0.0:8092//d/a7b6b...
craftes/y-sweet/src/server.rs
async fn auth_doc( .... let base_url = if let Some(url_prefix) = &server_state.url_prefix { // format!("{url_prefix}/d/{doc_id}") // I CHANGE TO format!("{url_prefix}d/{doc_id}") } else { format!("http://{host}/d/{doc_id}") }; ....
then it works!
What am I missing? Thanks!
The text was updated successfully, but these errors were encountered:
Thanks for reporting. You're not missing anything, that's a bug! I've opened #367 with a fix. Sorry about that!
Sorry, something went wrong.
Thanks for the quick response and fix!
Successfully merging a pull request may close this issue.
Hi, I tried run y-sweet server in local with folloing
docker-compose.yml
but when i tried
getDocAsUpdate
in my Next.js/doc/_docId_/route.ts
:I got the error message:
I found that the url
http://0.0.0.0:8092//d/a7b6b...
looks wired, so i edit thecraftes/y-sweet/src/server.rs
asthen it works!
What am I missing? Thanks!
The text was updated successfully, but these errors were encountered: