angular / angular-cli

CLI tool for Angular
https://cli.angular.io
MIT License
26.76k stars 11.97k forks source link

Application SSR Angular 7: Cannot read property 'forEachChild' of undefined #17194

Closed wilsonnovaes00 closed 4 years ago

wilsonnovaes00 commented 4 years ago

🐞 Bug report

Command (mark with an x)

Version Angular?

Your global Angular CLI version (9.0.5) is greater than your local version (7.3.9). The local Angular CLI version is used.

Angular CLI: 7.3.9 Node: 10.15.3 OS: darwin x64 Angular: 7.2.16 ... animations, common, compiler, compiler-cli, core, elements ... forms, http, language-service, platform-browser ... platform-browser-dynamic, platform-server, router

Package Version

@angular-devkit/architect 0.13.9 @angular-devkit/build-angular 0.13.9 @angular-devkit/build-optimizer 0.13.9 @angular-devkit/build-webpack 0.13.9 @angular-devkit/core 9.0.5 @angular-devkit/schematics 7.3.9 @angular/cdk 7.3.7 @angular/cli 7.3.9 @angular/material 7.3.7 @ngtools/webpack 7.3.9 @schematics/angular 7.3.9 @schematics/update 0.13.9 rxjs 6.5.4 typescript 3.2.4 webpack 4.29.0

Description

I have a SSR application, when I build the application it brakes after the webpack build.

πŸ”₯ Exception or Error


(...)/dist/prerender.js:360819
            node.importClause.namedBindings.forEachChild(function (name) {
                                            ^

TypeError: Cannot read property 'forEachChild' of undefined

Packages

{ "name": "marketplace", "version": "0.0.0", "scripts": { "ng": "ng", "start": "node --max_old_space_size=8048 ./node_modules/@angular/cli/bin/ng serve --aot --disableHostCheck", "build": "ng build", "build:qa": "ng build --configuration qa --base-href=/pp/web/ --deploy-url=/pp/web/", "build:pp": "ng build --configuration pp --base-href=/ --deploy-url=/", "test": "ng test --browsers Chrome_without_security", "test:ci": "ng test --code-coverage --progress false --watch false --browsers ChromeHeadlessCI", "test:ci:firefox": "ng test --code-coverage --progress false --watch false --browsers FirefoxHeadless", "test:ci:phantom": "ng test --code-coverage --progress false --watch false --browsers PhantomJS_custom", "lint": "ng lint", "e2e": "ng e2e", "compodoc": "npx compodoc -p src/tsconfig.app.json", "compile:server": "webpack --config webpack.server.config.js --progress --colors", "serve:ssr": "node local.js", "build:ssr": "npm run build:client-and-server-bundles && npm run compile:server", "build:client-and-server-bundles": "ng build --prod && ng run my-app-Marketplace:server:production", "server": "node local.js", "build:prod": "npm run build:ssr", "serve:prerender": "node static.js", "build:prerender": "npm run build:prod && node dist/prerender.js" }, "private": true, "dependencies": { "@angular-devkit/core": "^9.0.5", "@angular/animations": "^7.2.15", "@angular/cdk": "^7.3.7", "@angular/common": "^7.2.15", "@angular/compiler": "^7.2.15", "@angular/core": "^7.2.15", "@angular/elements": "^7.2.15", "@angular/forms": "^7.2.15", "@angular/http": "^7.2.15", "@angular/material": "^7.3.7", "@angular/platform-browser": "^7.2.15", "@angular/platform-browser-dynamic": "^7.2.15", "@angular/platform-server": "~7.2.0", "@angular/router": "^7.2.15", "@ng-toolkit/universal": "^7.1.2", "@nguniversal/common": "0.0.0", "@nguniversal/express-engine": "0.0.0", "@nguniversal/module-map-ngfactory-loader": "0.0.0", "@ngx-meta/core": "^8.0.2", "@ngx-share/button": "^7.1.4", "@ngx-share/core": "^7.1.4", "@types/gapi": "0.0.39", "@types/gapi.auth2": "0.0.50", "angular2-text-mask": "^9.0.0", "angulartics2": "^7.4.1", "ansi-escapes": "^4.2.1", "bootstrap": "^4.3.1", "chart.js": "^2.7.3", "classlist.js": "^1.1.20150312", "core-js": "^2.5.4", "domino": "^2.1.3", "express": "^4.17.1", "file-saver": "^2.0.2", "hammerjs": "^2.0.0", "jasmine-data-provider": "^2.2.0", "jwt-decode": "^2.2.0", "keycloak-angular": "^6.1.0", "localstorage-polyfill": "^1.0.1", "moment": "^2.24.0", "ngx-chips": "^2.0.2", "ngx-clipboard": "^12.2.1", "ngx-cookie-service": "^2.2.0", "ngx-device-detector": "^1.3.9", "ngx-infinite-scroll": "^7.0.0", "ngx-mask": "^8.1.2", "ngx-swiper-wrapper": "^7.2.1", "rxjs": "~6.5.2", "tslib": "^1.6.1", "web-animations-js": "^2.3.2", "zone.js": "~0.8.26" }, "devDependencies": { "@angular-devkit/build-angular": "~0.13.5", "@angular/cli": "~7.3.9", "@angular/compiler-cli": "^7.2.15", "@angular/language-service": "^7.2.15", "@types/jasmine": "~2.8.8", "@types/jasminewd2": "~2.0.3", "@types/node": "~8.9.4", "@typescript-eslint/eslint-plugin": "^2.6.1", "@typescript-eslint/parser": "^2.6.1", "angular-oauth2-oidc": "^5.0.2", "codelyzer": "~4.5.0", "eslint": "^6.6.0", "husky": "^3.0.8", "jasmine-core": "^3.5.0", "jasmine-spec-reporter": "^4.2.1", "karma": "^4.4.1", "karma-chrome-launcher": "^3.1.0", "karma-coverage-istanbul-reporter": "^2.1.0", "karma-firefox-launcher": "^1.2.0", "karma-jasmine": "^2.0.1", "karma-jasmine-html-reporter": "^1.4.2", "karma-phantomjs-launcher": "^1.0.4", "karma-spec-reporter": "0.0.32", "ng2-charts": "~2.2.3", "ng5-slider": "^1.2.4", "node-sass": "4.10.0", "protractor": "~5.4.0", "puppeteer": "^2.0.0", "ts-loader": "^5.4.3", "ts-node": "~7.0.0", "tslint": "~5.11.0", "typescript": "~3.2.2", "webpack-cli": "^3.3.11" }, "prettier": { "singleQuote": true } }

🌍 Your Environment


prod
alan-agius4 commented 4 years ago

Hi, can you try to update to Angular and Angular CLI version 9 and see if the problem persists?

You can read here on how to update http://update.angular.io/#7.0:9.0

If the problem persists after upgrading, please provide a simple repository reproducing the problem.

You can read here why this is needed. A good way to make a minimal repro is to create a new app via ng new repro-app and adding the minimum possible code to show the problem. Then you can push this repository to github and link it here.

alan-agius4 commented 4 years ago

Thanks for reporting this issue. However, you didn't provide sufficient information for us to understand and reproduce the problem. Please check out our submission guidelines to understand why we can't act on issues that are lacking important information.

If the problem persists, please file a new issue and ensure you provide all of the required information when filling out the issue template.

angular-automatic-lock-bot[bot] commented 4 years ago

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.