Skip to content

Commit

Permalink
fix: vercel warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
pedronauck committed Dec 28, 2024
1 parent efa874c commit 56049af
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
4 changes: 2 additions & 2 deletions packages/fuel-streams/src/ws/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export function getWebUrl(network: FuelNetwork): URL {
case FuelNetwork.Local:
return new URL('http://localhost:9003');
case FuelNetwork.Staging:
return new URL('http://localhost:9003');
return new URL('https://stream-staging.fuel.network');
case FuelNetwork.Testnet:
return new URL('https://stream-testnet.fuel.network');
case FuelNetwork.Mainnet:
Expand All @@ -32,7 +32,7 @@ export function getWsUrl(network: FuelNetwork): URL {
case FuelNetwork.Local:
return new URL('ws://0.0.0.0:9003');
case FuelNetwork.Staging:
return new URL('ws://localhost:9003');
return new URL('wss://stream-staging.fuel.network');
case FuelNetwork.Testnet:
return new URL('wss://stream-testnet.fuel.network');
case FuelNetwork.Mainnet:
Expand Down
12 changes: 9 additions & 3 deletions packages/fuel-streams/src/ws/platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,15 @@ if (typeof window !== 'undefined') {
} else {
// Node.js environment
try {
// Dynamic imports to avoid bundling node modules in browser builds
const WebSocket = require('ws');
wsImpl = WebSocket;
// Use dynamic import instead of require
import('ws')
.then((WebSocket) => {
// @ts-ignore
wsImpl = WebSocket.default;
})
.catch(() => {
throw new Error('Please install ws package for Node.js environment');
});
fetchImpl = fetch; // Use global fetch in Node.js environments
} catch (_e) {
throw new Error('Please install ws package for Node.js environment');
Expand Down
2 changes: 1 addition & 1 deletion packages/fuel-streams/src/ws/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { GenericRecord } from 'src/modules/subject-base';
import type { GenericRecord } from '../modules/subject-base';

export enum FuelNetwork {
Local = 'local',
Expand Down
2 changes: 1 addition & 1 deletion packages/simple-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"preview": "vite preview",
"test": "vitest run --passWithNoTests",
"test:coverage": "vitest run --coverage --passWithNoTests",
"test:e2e": "vitest run -c vitest.e2e.config.ts"
"test:e2e": "vitest run -c vitest.e2e.config.ts --passWithNoTests"
},
"dependencies": {
"@fuels/streams": "workspace:*",
Expand Down
3 changes: 2 additions & 1 deletion packages/simple-app/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import animate from 'tailwindcss-animate';
/** @type {import('tailwindcss').Config} */
export default {
darkMode: ['class'],
Expand Down Expand Up @@ -50,5 +51,5 @@ export default {
},
},
},
plugins: [require('tailwindcss-animate')],
plugins: [animate],
};

0 comments on commit 56049af

Please # to comment.