Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

465
Vistas
NestJS Monorepo Microservice EJS Error Failed to lookup view "index" in views directory "..\fin\dist\.."

I'm building a NestJS microservice app in monorepo with fin as the default microservice.

I'm using EJS templating.

But once I run the project, I get the error, "ERROR [ExceptionsHandler] Failed to lookup view "index" in views directory "D:\Studio\Work...\fin\dist\apps\views"".

I've tried different configurations for directory path in app.setBaseViewsDir() but all have not worked;

Could you please help me spot the problem?

Thanks in advance!

The project directory folder looks something like below;


+ fin
  + apps 
    + fin
      + src
        + views 

          -index.ejs

        -app.controller.ts

        -main.ts
  + image      

  -package.json

  -tsconfig.json

The fin main.ts file looks something like;

main.ts:


import { NestFactory } from '@nestjs/core';
import { NestExpressApplication } from '@nestjs/platform-express';
import { resolve } from 'path';
import { AppModule } from './app.module';

async function bootstrap() {
  const app = await NestFactory.create<NestExpressApplication>(AppModule);
  app.useStaticAssets(resolve('../src/assets'));
  app.setBaseViewsDir(resolve('../src/views'));
  app.setViewEngine('ejs');
  await app.listen(6006);
  console.log(`Fin PEN started successfully on Port 6006`);
}
bootstrap();

The tsconfig.json looks like below.

tsconfig.json:


{
  "compilerOptions": {
    ...
    "sourceMap": true,
    "outDir": "./dist",
    "baseUrl": "./"
    ...
  }
}

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda