Open gustjr123 opened 1 year ago
try other way and resolve it Thank you
Hi @gustjr123,
try to pass it as imports instead of providers
import { WssGateway } from './wss/wss.gateway';
import { Module } from '@nestjs/common';
@Module({
imports: [WssGateway],
})
export class AppModule {}
Thanks your reply I create new project for testing this case.
structure is this src └ main.ts └ wss.gateway.ts └ app.module.ts
app.module.ts
import { Module } from '@nestjs/common';
import { WssGateway} from './mediasoup.gateway';
@Module({
imports: [WssGateway],
controllers: [],
providers: [],
})
export class AppModule {}
wss.gateway.ts
import { BaseGateway } from '@nramos/nest-mediasoup-base';
export class WssGateway extends BaseGateway<any> {}
main.ts
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
await app.listen(3000);
}
bootstrap();
I follow your comment and this throw Error
/home/john/mediasoup/testes/test/node_modules/@nramos/nest-mediasoup-base/dist/lib/streaming/room.js:63
this.baseLogger.debug('createWebRtcTransport user', user?.userProfile);
^
SyntaxError: Unexpected token '.'
at wrapSafe (internal/modules/cjs/loader.js:915:16)
at Module._compile (internal/modules/cjs/loader.js:963:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/home/john/mediasoup/testes/test/node_modules/@nramos/nest-mediasoup-base/src/index.ts:7:1)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
I guess nestjs or mediasoup version was updated and conflict occurs in code.
PS. My problem has been solved now, so this is just my curiosity. I glad to your comment XD
Thank you for sharing your code!! I am not familar with nestjs and mediasoup
Now I have some problem.
I want to use your 'BaseGateway' by using 'extends'
So my gateway code is right this
and this is my module
but it is throw error
how can i resolve it?