Skip to content

Commit eb8455d

Browse files
committed
fix ws
1 parent c0c76bb commit eb8455d

File tree

3 files changed

+34
-17
lines changed

3 files changed

+34
-17
lines changed

client.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,11 @@ import { ApolloLink, concat, split } from 'apollo-link';
44
import { WebSocketLink } from 'apollo-link-ws';
55
import fetch from 'node-fetch';
66
import path from 'path';
7+
import ws from 'ws';
78
import { debug } from './debug';
89

910
const moduleLog = debug.extend('client')
1011

11-
let ws;
12-
if (typeof(window) !== 'object') {
13-
ws = require('ws');
14-
}
15-
1612
const DEEP_FOUNDATION_HASURA_RELATIVE: boolean | undefined = ((r) => r ? !!+r : undefined)(process.env.DEEP_FOUNDATION_HASURA_RELATIVE);
1713
const NEXT_PUBLIC_DEEP_FOUNDATION_HASURA_RELATIVE: boolean | undefined = ((r) => r ? !!+r : undefined)(process.env.NEXT_PUBLIC_DEEP_FOUNDATION_HASURA_RELATIVE);
1814

package-lock.json

Lines changed: 30 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
"normalize-url": "^7.0.2",
2424
"path": "^0.12.7",
2525
"rimraf": "^3.0.2",
26-
"ts-node": "^10.9.1"
26+
"ts-node": "^10.9.1",
27+
"ws": "^8.17.1"
2728
},
2829
"scripts": {
2930
"package:refresh": "rm -rf node_modules; rm -f package-lock.json; npm i",
@@ -47,7 +48,6 @@
4748
"apollo-link": "^1.2.14",
4849
"apollo-link-ws": "^1.0.20",
4950
"apollo-server-micro": "^2.21.0",
50-
"react": "^18.2.0",
51-
"ws": "^7.5.6"
51+
"react": "^18.2.0"
5252
}
5353
}

0 commit comments

Comments
 (0)