Angular 11 component is not resolved on Universal SSR Lambda

Viewed 166

When using Angular Universal with AWS Lambda Edge, the component cannot be resolved.

Error: Component 'AuthComponent' is not resolved:
 - templateUrl: ./auth.component.html
 - styleUrls: ["./auth.component.scss"]
Did you run and wait for 'resolveComponentResources()'?
    at Function.get (/var/task/dist/project/server.js:27891:27)
    at getComponentDef (/var/task/dist/project/server.js:1663:16)
    at verifyDeclarationsHaveDefinitions (/var/task/dist/project/server.js:27574:21)
    at Array.forEach (<anonymous>)
    at verifySemanticsOfNgModuleDef (/var/task/dist/project/server.js:27546:18)
    at flatten.map.forEach.mod (/var/task/dist/project/server.js:27543:9)
    at Array.forEach (<anonymous>)
    at verifySemanticsOfNgModuleDef (/var/task/dist/project/server.js:27541:60)
    at flatten.map.forEach.mod (/var/task/dist/project/server.js:27543:9)
    at Array.forEach (<anonymous>)

We are running "build:serverless:deploy". Detailed commands are:

"build:serverless": "npm run build:browser:serverless && npm run build:server:serverless",
"build:serverless:deploy": "npm run build:serverless && npm run deploy",
"deploy": "serverless deploy",

This is our AuthComponent.

import { Component} from '@angular/core';

@Component({
    selector: 'kt-auth',
    templateUrl: './auth.component.html',
    styleUrls: ['./auth.component.scss'],
})
export class AuthComponent {
    today: number = Date.now();
}

We are using Angular 11.

0 Answers
Related