Skip to content

Commit

Permalink
fix: avoid error while running any patch (#3209)
Browse files Browse the repository at this point in the history
Here enabled patches, map and set in immer which were broken after
moving canvas and builder to client side.
  • Loading branch information
TrySound authored Apr 19, 2024
1 parent 129aa5d commit 7c36918
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion apps/builder/app/routes/rest.patch.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { applyPatches } from "immer";
import { applyPatches, enableMapSet, enablePatches } from "immer";
import type { ActionFunctionArgs } from "@remix-run/server-runtime";
import type { SyncItem } from "immerhin";
import { prisma } from "@webstudio-is/prisma-client";
Expand Down Expand Up @@ -46,6 +46,9 @@ type PatchData = {
};

export const action = async ({ request }: ActionFunctionArgs) => {
enableMapSet();
enablePatches();

try {
const {
buildId,
Expand Down

0 comments on commit 7c36918

Please sign in to comment.