Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Property 'listen' does not exist on type 'Promise<INestApplication>'. #3

Open
NineSenz opened this issue Jul 20, 2023 · 1 comment

Comments

@NineSenz
Copy link

In the index.ts file, the NestFactory object created cannot directly listen to the port via app.listen()

@NineSenz
Copy link
Author

I revised it. src/index.ts

const app = NestFactory.create(ApplicationModule, instance);
// app.listen(3000, () => console.log('Applicacion is listening on port 3000'));

app.then(nestInstance =>
    nestInstance.listen(3000, () => {
      console.log('Applicacion is listening on port 3000');
    })
  ).catch(err => {
    console.error(
      'Application is listen on port 3000 failed to start',
      err
    );
  });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant