-
Notifications
You must be signed in to change notification settings - Fork 38
Open
Description
Tried to follow the Next.js guide on your website https://www.rivet.dev/docs/actors/quickstart/next-js/ but ended up having problems. Rivetkit tries to make PUT request to the defined endpoint /api/rivet/[...all]/route.ts

Although when you take a look at the implementation of toNextHandler
. It does not export any PUT
-method. This seemed quite simple function so I tried guessing and implemented it myself to the route.ts like this:
import { registry } from "@/rivet/registry";
import { Registry, RunConfigInput } from "rivetkit";
const toNextHandler = (
registry: Registry<any>,
inputConfig: RunConfigInput = {}
) => {
// Don't run server locally since we're using the fetch handler directly
inputConfig.disableServer = true;
inputConfig.basePath = "/api/rivet";
const { fetch } = registry.start(inputConfig);
return {
GET: fetch,
POST: fetch,
PATCH: fetch,
PUT: fetch,
HEAD: fetch,
OPTIONS: fetch,
};
};
// Export the Next.js handler for the API routes
export const { GET, POST, HEAD, PATCH, OPTIONS, PUT } = toNextHandler(registry);
But then I started to get following errors:
level=WARN msg="internal error" error="Offset is outside the bounds of the DataView" stack="RangeError: Offset is outside the bounds of the DataView\n at DataView.prototype.getUint32 (<anonymous>)\n ...
I used the latest version of rivetkit.
magisters-cc
Metadata
Metadata
Assignees
Labels
No labels