сборка при запуске npm: ssr выдает несколько предупреждений о nestjs

#angular #nestjs #angular-universal

#angular #nestjs #angular-универсальный

Вопрос:

Я пытаюсь настроить angular universal в новом проекте angular

server/app.module.ts

 import { Module } from '@nestjs/common';
import { AngularUniversalModule } from '@nestjs/ng-universal';
import { join } from 'path';
import { AppServerModule } from '../src/main.server';

@Module({
  imports: [
    AngularUniversalModule.forRoot({
      bootstrap: AppServerModule,
      viewsPath: join(process.cwd(), 'dist/bharatas/browser')
    })
  ]
})
export class AppModule {}

 

app.server.module.ts

 import { NgModule } from '@angular/core';
import { ServerModule } from '@angular/platform-server';

import { AppModule } from './app.module';
import { AppComponent } from './app.component';
import { ModuleMapLoaderModule } from '@nguniversal/module-map-ngfactory-loader';

@NgModule({
  imports: [
    AppModule,
    ServerModule,
    ModuleMapLoaderModule
  ],
  bootstrap: [AppComponent],
})
export class AppServerModule {}


 
 
> bharatas@0.0.0 prebuild:ssr C:wamp64wwwbharatas
> ngcc

Compiling @angular/core/testing : fesm2015 as esm2015
Compiling @angular/platform-browser/testing : fesm2015 as esm2015
Compiling @angular/compiler/testing : fesm2015 as esm2015
Compiling @angular/common/testing : fesm2015 as esm2015
Compiling @angular/animations/browser/testing : fesm2015 as esm2015
Compiling @angular/common/http/testing : fesm2015 as esm2015
Compiling @angular/forms : fesm2015 as esm2015
Compiling @angular/platform-browser-dynamic/testing : fesm2015 as esm2015
Compiling @angular/router/testing : fesm2015 as esm2015
Compiling @nguniversal/common : fesm2015 as esm2015
Compiling @angular/platform-server/testing : fesm2015 as esm2015
Compiling @angular/animations : esm2015 as esm2015
Compiling @angular/core : esm2015 as esm2015
Compiling @angular/animations : main as umd
Compiling @angular/animations/browser : esm2015 as esm2015
Compiling @angular/core : main as umd
Compiling @angular/animations/browser : main as umd
Compiling @angular/animations/browser/testing : esm2015 as esm2015
Compiling @angular/animations/browser/testing : main as umd
Compiling @angular/common : esm2015 as esm2015
Compiling @angular/common/http : esm2015 as esm2015
Compiling @angular/common : main as umd
Compiling @angular/common/http/testing : esm2015 as esm2015
Compiling @angular/common/http : main as umd
Compiling @angular/common/http/testing : main as umd
Compiling @angular/forms : esm2015 as esm2015
Compiling @angular/forms : main as umd
Compiling @angular/core/testing : esm2015 as esm2015
Compiling @angular/core/testing : main as umd
Compiling @angular/platform-browser : esm2015 as esm2015
Compiling @angular/platform-browser : main as umd
Compiling @angular/platform-browser-dynamic : esm2015 as esm2015
Compiling @angular/platform-browser-dynamic : main as umd
Compiling @angular/platform-browser/testing : esm2015 as esm2015
Compiling @angular/platform-browser/testing : main as umd
Compiling @angular/compiler/testing : esm2015 as esm2015
Compiling @angular/compiler/testing : main as umd
Compiling @angular/platform-browser-dynamic/testing : esm2015 as esm2015
Compiling @angular/platform-browser-dynamic/testing : main as umd
Compiling @angular/platform-browser/animations : esm2015 as esm2015
Compiling @angular/platform-browser/animations : main as umd
Compiling @angular/platform-server : esm2015 as esm2015
Compiling @angular/platform-server : main as umd
Compiling @angular/platform-server/testing : esm2015 as esm2015
Compiling @angular/platform-server/testing : main as umd
Compiling @angular/common/testing : esm2015 as esm2015
Compiling @angular/common/testing : main as umd
Compiling @angular/router : esm2015 as esm2015
Compiling @angular/router : main as umd
Compiling @angular/router/testing : esm2015 as esm2015
Compiling @angular/router/testing : main as umd
Compiling @nguniversal/common : esm2015 as esm2015
Compiling @nguniversal/common : main as umd
Compiling @nguniversal/common/engine : esm2015 as esm2015
Compiling @nguniversal/express-engine/tokens : esm2015 as esm2015
Compiling @nguniversal/common/engine : main as umd
Compiling @nguniversal/express-engine/tokens : main as umd
Compiling @nguniversal/express-engine : esm2015 as esm2015
Compiling @nguniversal/express-engine : main as umd
Compiling @nguniversal/module-map-ngfactory-loader : fesm5 as esm5
Compiling @nguniversal/module-map-ngfactory-loader : esm2015 as esm2015
Compiling @nguniversal/module-map-ngfactory-loader : esm5 as esm5
Compiling @nguniversal/module-map-ngfactory-loader : main as umd

> bharatas@0.0.0 build:ssr C:wamp64wwwbharatas
> ng build --prod amp;amp; ng run bharatas:server:production

√ Browser application bundle generation complete.
√ Copying assets complete.
√ Index html generation complete.

Initial Chunk Files               | Names         |      Size
main.002f3d163ff06a7c596b.js      | main          | 268.23 kB
polyfills.8c151b8375e767ff858f.js | polyfills     |  36.00 kB
runtime.0e49e2b53282f40c8925.js   | runtime       |   1.45 kB
styles.09e2c710755c8867a460.css   | styles        |   0 bytes

                                  | Initial Total | 305.68 kB

Build at: 2020-12-13T06:22:00.216Z - Hash: 27b7d13764543daefcb8 - Time: 40277ms
√ Server application bundle generation complete.

Initial Chunk Files | Names         |    Size
main.js             | main          | 8.28 MB

                    | Initial Total | 8.28 MB

Build at: 2020-12-13T06:22:44.235Z - Hash: 516b9517e43fa1377b6e - Time: 33806ms

Warning: ./node_modules/@nestjs/core/helpers/optional-require.js 6:39-59
Critical dependency: the request of a dependency is an expression
    at CommonJsRequireContextDependency.getWarnings (C:wamp64wwwbharatasnode_moduleswebpacklibdependenciesContextDependency.js:40:18)
    at Compilation.reportDependencyErrorsAndWarnings (C:wamp64wwwbharatasnode_moduleswebpacklibCompilation.js:1454:24)
    at C:wamp64wwwbharatasnode_moduleswebpacklibCompilation.js:1258:10
    at AsyncSeriesHook.eval [as callAsync] (eval at create (C:wamp64wwwbharatasnode_moduleswebpacknode_modulestapablelibHookCodeFactory.js:33:10), <anonymous>:29:1)
    at AsyncSeriesHook.lazyCompileHook (C:wamp64wwwbharatasnode_moduleswebpacknode_modulestapablelibHook.js:154:20)
    at Compilation.finish (C:wamp64wwwbharatasnode_moduleswebpacklibCompilation.js:1253:28)
    at C:wamp64wwwbharatasnode_moduleswebpacklibCompiler.js:672:17
    at _done (eval at create (C:wamp64wwwbharatasnode_moduleswebpacknode_modulestapablelibHookCodeFactory.js:33:10), <anonymous>:7:1)
    at eval (eval at create (C:wamp64wwwbharatasnode_moduleswebpacknode_modulestapablelibHookCodeFactory.js:33:10), <anonymous>:34:22)
    at C:wamp64wwwbharatasnode_moduleswebpacklibCompilation.js:1185:12
    at C:wamp64wwwbharatasnode_moduleswebpacklibCompilation.js:1097:9
    at processTicksAndRejections (internal/process/task_queues.js:79:11)
 @ ./node_modules/@nestjs/core/nest-application.js
 @ ./node_modules/@nestjs/core/index.js
 @ ./server/main.ts
 @ ./server.ts
 @ multi ./server.ts

[0mWarning: ./node_modules/@nestjs/core/helpers/load-adapter.js 9:39-63
Critical dependency: the request of a dependency is an expression
    at CommonJsRequireContextDependency.getWarnings (C:wamp64wwwbharatasnode_moduleswebpacklibdependenciesContextDependency.js:40:18)
    at Compilation.reportDependencyErrorsAndWarnings (C:wamp64wwwbharatasnode_moduleswebpacklibCompilation.js:1454:24)
    at C:wamp64wwwbharatasnode_moduleswebpacklibCompilation.js:1258:10
    at AsyncSeriesHook.eval [as callAsync] (eval at create (C:wamp64wwwbharatasnode_moduleswebpacknode_modulestapablelibHookCodeFactory.js:33:10), <anonymous>:29:1)
    at AsyncSeriesHook.lazyCompileHook (C:wamp64wwwbharatasnode_moduleswebpacknode_modulestapablelibHook.js:154:20)
    at Compilation.finish (C:wamp64wwwbharatasnode_moduleswebpacklibCompilation.js:1253:28)
    at C:wamp64wwwbharatasnode_moduleswebpacklibCompiler.js:672:17
    at _done (eval at create (C:wamp64wwwbharatasnode_moduleswebpacknode_modulestapablelibHookCodeFactory.js:33:10), <anonymous>:7:1)
    at eval (eval at create (C:wamp64wwwbharatasnode_moduleswebpacknode_modulestapablelibHookCodeFactory.js:33:10), <anonymous>:34:22)
    at C:wamp64wwwbharatasnode_moduleswebpacklibCompilation.js:1185:12
    at C:wamp64wwwbharatasnode_moduleswebpacklibCompilation.js:1097:9
    at processTicksAndRejections (internal/process/task_queues.js:79:11)
 @ ./node_modules/@nestjs/core/nest-factory.js
 @ ./node_modules/@nestjs/core/index.js
 @ ./server/main.ts
 @ ./server.ts
 @ multi ./server.ts

Warning: ./node_modules/@nestjs/common/utils/load-package.util.js 9:39-59
Critical dependency: the request of a dependency is an expression
    at CommonJsRequireContextDependency.getWarnings (C:wamp64wwwbharatasnode_moduleswebpacklibdependenciesContextDependency.js:40:18)
    at Compilation.reportDependencyErrorsAndWarnings (C:wamp64wwwbharatasnode_moduleswebpacklibCompilation.js:1454:24)
    at C:wamp64wwwbharatasnode_moduleswebpacklibCompilation.js:1258:10
    at AsyncSeriesHook.eval [as callAsync] (eval at create (C:wamp64wwwbharatasnode_moduleswebpacknode_modulestapablelibHookCodeFactory.js:33:10), <anonymous>:29:1)
    at AsyncSeriesHook.lazyCompileHook (C:wamp64wwwbharatasnode_moduleswebpacknode_modulestapablelibHook.js:154:20)
    at Compilation.finish (C:wamp64wwwbharatasnode_moduleswebpacklibCompilation.js:1253:28)
    at C:wamp64wwwbharatasnode_moduleswebpacklibCompiler.js:672:17
    at _done (eval at create (C:wamp64wwwbharatasnode_moduleswebpacknode_modulestapablelibHookCodeFactory.js:33:10), <anonymous>:7:1)
    at eval (eval at create (C:wamp64wwwbharatasnode_moduleswebpacknode_modulestapablelibHookCodeFactory.js:33:10), <anonymous>:34:22)
    at C:wamp64wwwbharatasnode_moduleswebpacklibCompilation.js:1185:12
    at C:wamp64wwwbharatasnode_moduleswebpacklibCompilation.js:1097:9
    at processTicksAndRejections (internal/process/task_queues.js:79:11)
 @ ./node_modules/@nestjs/common/pipes/validation.pipe.js
 @ ./node_modules/@nestjs/common/pipes/index.js
 @ ./node_modules/@nestjs/common/index.js
 @ ./server/app.module.ts
 @ ./server/main.ts
0m @ ./server.ts
 @ multi ./server.ts

 

Есть идеи, почему я получаю так много предупреждений при запуске npm run build:ssr ?