You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ ] Regression
[X] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.
Current behavior
When I add swagger and swagger-ui for documentation and statics. It doesn't load work. I get errors on the startup.
Following error was provided:
{ Error: ENOENT: no such file or directory, open '//indexTemplate.html'
at Object.fs.openSync (fs.js:577:3)
at Object.fs.readFileSync (fs.js:483:33)
at Object.generateHTML (/Users/bovandersteene/projects/github/talks/angular-connect/collection/dist/server.js:168517:16)
at Function.setup (/Users/bovandersteene/projects/github/talks/angular-connect/collection/dist/server.js:168461:39)
at /Users/bovandersteene/projects/github/talks/angular-connect/collection/dist/server.js:168:83
at step (/Users/bovandersteene/projects/github/talks/angular-connect/collection/dist/server.js:131:23)
at Object.next (/Users/bovandersteene/projects/github/talks/angular-connect/collection/dist/server.js:112:53)
at fulfilled (/Users/bovandersteene/projects/github/talks/angular-connect/collection/dist/server.js:103:58)
at ZoneDelegate.invoke (/Users/bovandersteene/projects/github/talks/angular-connect/collection/dist/server.js:170788:26)
at Zone.run (/Users/bovandersteene/projects/github/talks/angular-connect/collection/dist/server.js:170538:43)
errno: -2,
syscall: 'open',
code: 'ENOENT',
path: '//indexTemplate.html' }
Expected behavior
Access for swagger should be provided
Minimal reproduction of the problem with instructions
Add swagger to your main.ts file
import { NestFactory } from '@nestjs/core';
import { AppModule } from './src/app.module';
import * as swStats from 'swagger-stats';
import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';
import { enableProdMode } from '@angular/core';
enableProdMode();
async function bootstrap() {
const app = await NestFactory.create(AppModule);
app.enableCors({
methods: 'GET',
maxAge: 3600,
});
const options = new DocumentBuilder()
.setTitle('My-Collection backend')
.setDescription('The collection api')
.setVersion('1.0')
.addTag('reibo')
.build();
const document = SwaggerModule.createDocument(app, options);
SwaggerModule.setup('swagger', app, document);
app.use(swStats.getMiddleware());
await app.listen(4000);
}
bootstrap().catch(err => console.error(err));
What is the motivation / use case for changing the behavior?
Environment
Nest version: 5.3.10
For Tooling issues:
- Node version: XX v10.2.1
- Platform: Mac
Others:
The text was updated successfully, but these errors were encountered:
This is caused due to the way in how the underlying swagger UI library works. Unfortunately, we cannot do anything in this case. I'd suggest adding an issue to the swagger-ui-express repository though (lack of webpack compatibility).
I'm submitting a...
Current behavior
When I add swagger and swagger-ui for documentation and statics. It doesn't load work. I get errors on the startup.
Following error was provided:
Expected behavior
Access for swagger should be provided
Minimal reproduction of the problem with instructions
Add swagger to your main.ts file
What is the motivation / use case for changing the behavior?
Environment
The text was updated successfully, but these errors were encountered: