question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error in SSR if server build with `bundleDependencies=all`

See original GitHub issue

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Command (mark with an x)

- [ ] new
- [ ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [x] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Versions

Angular CLI: 6.2.1 Node: 8.11.2 OS: darwin x64 Angular: 6.1.7 … animations, common, compiler, compiler-cli, core, forms … http, language-service, platform-browser … platform-browser-dynamic, platform-server, router … service-worker

Package Version

@angular-devkit/architect 0.8.1 @angular-devkit/build-angular 0.8.1 @angular-devkit/build-ng-packagr 0.8.1 @angular-devkit/build-optimizer 0.8.1 @angular-devkit/build-webpack 0.8.1 @angular-devkit/core 0.8.1 @angular-devkit/schematics 0.8.1 @angular/cdk 6.4.7 @angular/cli 6.2.1 @angular/flex-layout 6.0.0-beta.18 @angular/material 6.4.7 @angular/pwa 0.8.1 @ngtools/json-schema 1.1.0 @ngtools/webpack 6.2.1 @schematics/angular 0.8.1 @schematics/update 0.8.1 ng-packagr 4.1.1 rxjs 6.3.2 typescript 2.9.2 webpack 4.18.0

Repro steps

I use universal-starter, only change one line in angular.json:

"server": {
  "configurations": {
    "production": {
      "bundleDependencies": "all", <= added
      ...
$ git clone -b issue-error-with-bundleDependencies  git@github.com:clarkorz/universal-starter.git
$ cd universal-starter
$ yarn install
$ yarn build:ssr
$ yarn serve:ssr

Access http://localhost:4000 in browser.

The log given by the failure

Error: No NgModule metadata found for '[object Object]'.
    at NgModuleResolver.resolve (/Users/wangshuo/Documents/GitHub/universal-starter/node_modules/@angular/compiler/bundles/compiler.umd.js:11962:27)
    at CompileMetadataResolver.getNgModuleMetadata (/Users/wangshuo/Documents/GitHub/universal-starter/node_modules/@angular/compiler/bundles/compiler.umd.js:10604:47)
    at JitCompiler._loadModules (/Users/wangshuo/Documents/GitHub/universal-starter/node_modules/@angular/compiler/bundles/compiler.umd.js:23914:55)
    at JitCompiler._compileModuleAndComponents (/Users/wangshuo/Documents/GitHub/universal-starter/node_modules/@angular/compiler/bundles/compiler.umd.js:23895:40)
    at JitCompiler.compileModuleAsync (/Users/wangshuo/Documents/GitHub/universal-starter/node_modules/@angular/compiler/bundles/compiler.umd.js:23855:41)
    at CompilerImpl.compileModuleAsync (/Users/wangshuo/Documents/GitHub/universal-starter/node_modules/@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js:195:35)
    at /Users/wangshuo/Documents/GitHub/universal-starter/node_modules/@nguniversal/express-engine/bundles/express-engine.umd.js:95:25
    at new ZoneAwarePromise (/Users/wangshuo/Documents/GitHub/universal-starter/node_modules/zone.js/dist/zone-node.js:891:29)
    at getFactory (/Users/wangshuo/Documents/GitHub/universal-starter/node_modules/@nguniversal/express-engine/bundles/express-engine.umd.js:81:12)
    at View.engine (/Users/wangshuo/Documents/GitHub/universal-starter/node_modules/@nguniversal/express-engine/bundles/express-engine.umd.js:60:13)

Desired functionality

bundleDependencies=all should work as same as bundleDependencies=none.

Mention any other details that might be useful

No.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:5
  • Comments:19 (7 by maintainers)

github_iconTop GitHub Comments

5reactions
vikermancommented, May 24, 2019

@ErazerBrecht - We think we have a solution for version 8.0.

4reactions
vikermancommented, Jan 31, 2019

On it (again). Investigating the root cause.

Read more comments on GitHub >

github_iconTop Results From Across the Web

node.js - Angular 9.0 SSR is compiled, but I cannot publish it ...
I ran the command “npm run build: ssr && npm run serve: ssr”. It worked flawlessly and “browser” and “server” folders were created...
Read more >
Server-Side Rendering - Vite
Vite provides built-in support for server-side rendering (SSR). ... Treat all dependencies as noExternal; Throw an error if any Node.js built-ins are ...
Read more >
Error running angular-fire with universal SSR - Google Groups
App gets built successfully and runs without any exceptions when from the root folder. The problem arises when the app is executed outside ......
Read more >
The build Property - Nuxt
This option is automatically set based on mode value if not provided. standalone. Inline server bundle dependencies (advanced). Type: Boolean; Default: false.
Read more >
Ionic angular server side rendering showing to many errors
My whole IONIC project uploaded on Github https://github.com/yashdabi/ionic-angular-ssr following some tutorials like this below ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found