vbhv
vbhv
TtRPC
Created by vbhv on 1/27/2025 in #❓-help
issue with compiling/building websocket server
how to compile/build a separate websocket server , facing above issues , even tried to use some code from this https://github.com/trpc/examples-next-prisma-websockets-starter/blob/main/tsconfig.server.json but it compiles the entire src code which is not needed ig my tsconfig.json
{
"compilerOptions": {
"esModuleInterop": true,
"skipLibCheck": true,
"target": "ES2022",
"allowJs": true,
"resolveJsonModule": true,
"moduleDetection": "force",
"isolatedModules": true,
"strict": true,
"noUncheckedIndexedAccess": true,
"checkJs": true,
"lib": ["dom", "dom.iterable", "ES2022"],
"noEmit": true,
"moduleResolution": "bundler",
"module": "esnext",
"jsx": "preserve",
"plugins": [
{
"name": "next"
}
],
"incremental": true,
"baseUrl": ".",
"paths": {
"~/*": ["./src/*"],
"@/*": ["./src/*"]
},
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true
},
"include": [
".eslintrc.cjs",
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
"**/*.cjs",
"**/*.js",
".next/types/**/*.ts"
],
"exclude": ["node_modules", "dist"]
}
{
"compilerOptions": {
"esModuleInterop": true,
"skipLibCheck": true,
"target": "ES2022",
"allowJs": true,
"resolveJsonModule": true,
"moduleDetection": "force",
"isolatedModules": true,
"strict": true,
"noUncheckedIndexedAccess": true,
"checkJs": true,
"lib": ["dom", "dom.iterable", "ES2022"],
"noEmit": true,
"moduleResolution": "bundler",
"module": "esnext",
"jsx": "preserve",
"plugins": [
{
"name": "next"
}
],
"incremental": true,
"baseUrl": ".",
"paths": {
"~/*": ["./src/*"],
"@/*": ["./src/*"]
},
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true
},
"include": [
".eslintrc.cjs",
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
"**/*.cjs",
"**/*.js",
".next/types/**/*.ts"
],
"exclude": ["node_modules", "dist"]
}
tsconfig.server.json (for websocket server)
{
"extends": "./tsconfig.json",
"compilerOptions": {
"moduleResolution": "NodeNext",
"module": "NodeNext",
"outDir": "dist",
"isolatedModules": false,
"noEmit": false
},
"paths": {
"~/*": ["./src/*"]
},
"include": [
"src/server/wsServer.ts",
"src/server/api/root.ts",
"src/server/api/trpc.ts",
"src/server/api/routers/**/*.ts",
"src/server/db.ts",
"src/env.ts"
],
"exclude": [
"node_modules",
".next",
"**/*.test.ts",
"**/*.spec.ts",
"src/app",
"src/components",
"src/**/*.tsx"
]
}
{
"extends": "./tsconfig.json",
"compilerOptions": {
"moduleResolution": "NodeNext",
"module": "NodeNext",
"outDir": "dist",
"isolatedModules": false,
"noEmit": false
},
"paths": {
"~/*": ["./src/*"]
},
"include": [
"src/server/wsServer.ts",
"src/server/api/root.ts",
"src/server/api/trpc.ts",
"src/server/api/routers/**/*.ts",
"src/server/db.ts",
"src/env.ts"
],
"exclude": [
"node_modules",
".next",
"**/*.test.ts",
"**/*.spec.ts",
"src/app",
"src/components",
"src/**/*.tsx"
]
}
4 replies
TtRPC
Created by vbhv on 6/28/2024 in #❓-help
websocket or sse
So, im implementing real time transcription using google api , so should i use sockets or sse in trpc for this? im using nextjs btw , also tried integrate sockets in my app , its pretty complex for a noob coder like me
15 replies