Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

Fix saas builder (#1490)

Ivan Starkov42ac3d7e8dfb
diff --git a/packages/trpc-interface/package.json b/packages/trpc-interface/package.json
index 568294f34f..63cae43804 100644
--- a/packages/trpc-interface/package.json
+++ b/packages/trpc-interface/package.json
@@ -18,6 +18,7 @@
"@trpc/client": "^10.9.0",
"@trpc/server": "^10.9.0",
"@webstudio-is/prisma-client": "workspace:^",
+ "node-fetch": "2",
"uuid": "^9.0.0",
"zod": "^3.19.1"
},
diff --git a/packages/trpc-interface/src/shared/client.ts b/packages/trpc-interface/src/shared/client.ts
index e5cca3b0dd..108ffd155c 100644
--- a/packages/trpc-interface/src/shared/client.ts
+++ b/packages/trpc-interface/src/shared/client.ts
@@ -1,3 +1,4 @@
+import fetch from "node-fetch";
import { createTRPCProxyClient, httpBatchLink } from "@trpc/client";
import {
sharedRouter,
@@ -19,6 +20,9 @@ export const createTrpcProxyServiceClient = (
const remoteClient = createTRPCProxyClient<SharedRouter>({
links: [
httpBatchLink({
+ // httpBatchLink uses lib.dom.d.ts's fetch type
+ // which is incompatible with node fetch type.
+ fetch: fetch as never,
url: options.url,
headers: () => ({
Authorization: options.token,
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 7facdbec86..39a0a208c8 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -1339,6 +1339,9 @@ importers:
'@webstudio-is/prisma-client':
specifier: workspace:^
version: link:../prisma-client
+ node-fetch:
+ specifier: '2'
+ version: 2.6.9
uuid:
specifier: ^9.0.0
version: 9.0.0
@@ -13801,7 +13804,7 @@ packages:
resolution: {integrity: sha512-qvUtwJ3j6qwsF3jLxkZ72qCgjMysPzDfeV240JHiGZsANBYd+EEuu35v7dfrJ9Up0Ak07D7GGSkGhCHTqg/5wA==}
dependencies:
- node-fetch: 2.6.7
+ node-fetch: 2.6.9
whatwg-fetch: 3.6.2
transitivePeerDependencies:
- encoding
@@ -15640,18 +15643,6 @@ packages:
dependencies:
minimatch: 3.1.2
- resolution: {integrity: sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==}
- engines: {node: 4.x || >=6.0.0}
- peerDependencies:
- encoding: ^0.1.0
- peerDependenciesMeta:
- encoding:
- optional: true
- dependencies:
- whatwg-url: 5.0.0
- dev: false
-
resolution: {integrity: sha512-DJm/CJkZkRjKKj4Zi4BsKVZh3ValV5IR5s7LVZnW+6YMh0W1BfNA8XSs6DLMGYlId5F3KnA70uu2qepcR08Qqg==}
engines: {node: 4.x || >=6.0.0}