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

Error after upgrading to nest 6 and ng-universal 0.4.0 #21

Closed
tuurbo opened this issue Mar 18, 2019 · 2 comments
Closed

Error after upgrading to nest 6 and ng-universal 0.4.0 #21

tuurbo opened this issue Mar 18, 2019 · 2 comments

Comments

@tuurbo
Copy link

tuurbo commented Mar 18, 2019

I'm submitting a...


[ ] 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

Updated to nest 6 and ng-universal 0.4.0

"@nestjs/common": "^6.0.1",
"@nestjs/core": "^6.0.1",
"@nestjs/ng-universal": "^0.4.0",
"@nestjs/testing": "^6.0.1",
"@nestjs/platform-express": "^6.0.1",

Getting the error below...

###############
[Nest] 7920 - 03/18/2019, 3:58 PM [NestFactory] Starting Nest application...
[Nest] 7920 - 03/18/2019, 3:58 PM [ExceptionHandler] Nest can't resolve dependencies of the AngularUniversalModule (ANGULAR_UNIVERSAL_OPTIONS, ?). Please make sure that the argument at index [1] is available in the AngularUniversalModule context. +22ms
###############

// main.ts
import { enableProdMode } from '@angular/core';
import { NestFactory } from '@nestjs/core';
import { NestExpressApplication } from '@nestjs/platform-express';
import { ApplicationModule } from './app.module';

enableProdMode();

async function bootstrap() {
    const app = await NestFactory.create<NestExpressApplication>(ApplicationModule);

    app.enableCors({
        methods: 'GET',
        maxAge: 3600,
    });

    await app.listen(process.env.PORT);
}

bootstrap().catch(err => console.error(err));
// app.module.ts
import { Module } from '@nestjs/common';
import { AngularUniversalModule } from '@nestjs/ng-universal';
import { join } from 'path';

import { HelmetModule } from './middlewares/helmet.module';
import { SessionModule } from './middlewares/session.module';
import { RoutesController } from './routes/routes.controller';

@Module({
    imports: [
        HelmetModule,
        SessionModule,
        AngularUniversalModule.forRoot({
            viewsPath: join(process.cwd(), 'dist/app'),
            bundle: require('./../dist/server/main.js'),
        }),
    ],
    controllers: [RoutesController],
})
export class ApplicationModule { }

Let me know if you need anything else. Thanks

@kamilmysliwiec
Copy link
Member

kamilmysliwiec commented Mar 19, 2019

Fixed in 0.4.2 :)

@tuurbo
Copy link
Author

tuurbo commented Mar 19, 2019

Thanks :)

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

2 participants