angular / angular-cli

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

angular-cli won't bootstrap with wrapped bootstrap code #6930

Closed e-cloud closed 5 years ago

e-cloud commented 7 years ago

Bug Report or Feature Request (mark with an x)

Versions.

    _                      _                 ____ _     ___
   / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
  / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
 / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
/_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
               |___/
@angular/cli: 1.2.0
node: 7.10.0
os: linux x64
@angular/animations: 4.2.6
@angular/cdk: 2.0.0-beta.8
@angular/common: 4.2.6
@angular/compiler: 4.2.6
@angular/core: 4.2.6
@angular/forms: 4.2.6
@angular/http: 4.2.6
@angular/material: 2.0.0-beta.8
@angular/platform-browser: 4.2.6
@angular/platform-browser-dynamic: 4.2.6
@angular/router: 4.2.6
@angular/cli: 1.2.0
@angular/compiler-cli: 4.2.6
@angular/language-service: 4.2.6

Repro steps.

Workable version

https://github.com/e-cloud/ngrx-store-hmr-integration/tree/master The master branch works with shadowed variable -- AppModule in main.ts, which will be blamed by tslint

Unworkable version

https://github.com/e-cloud/ngrx-store-hmr-integration/tree/issue-with-cli The issue-with-cli branch does not work with refactored variable -- Module in main.ts

The log given by the failure.(For unworkable version)

Tried to find bootstrap code, but could not. Specify either statically analyzable bootstrap code or pass in an entryModule to the plugins options.
Error: Tried to find bootstrap code, but could not. Specify either statically analyzable bootstrap code or pass in an entryModule to the plugins options.
    at Object.resolveEntryModuleFromMain (/home/cloud/devlab/ngrx-store-hmr-integration/node_modules/@ngtools/webpack/src/entry_resolver.js:128:11)
    at AotPlugin._setupOptions (/home/cloud/devlab/ngrx-store-hmr-integration/node_modules/@ngtools/webpack/src/plugin.js:143:50)
    at new AotPlugin (/home/cloud/devlab/ngrx-store-hmr-integration/node_modules/@ngtools/webpack/src/plugin.js:26:14)
    at _createAotPlugin (/home/cloud/devlab/ngrx-store-hmr-integration/node_modules/@angular/cli/models/webpack-configs/typescript.js:55:12)
    at Object.exports.getNonAotConfig (/home/cloud/devlab/ngrx-store-hmr-integration/node_modules/@angular/cli/models/webpack-configs/typescript.js:70:19)
    at NgCliWebpackConfig.buildConfig (/home/cloud/devlab/ngrx-store-hmr-integration/node_modules/@angular/cli/models/webpack-config.js:27:37)
    at Class.run (/home/cloud/devlab/ngrx-store-hmr-integration/node_modules/@angular/cli/tasks/serve.js:38:98)
    at check_port_1.checkPort.then.port (/home/cloud/devlab/ngrx-store-hmr-integration/node_modules/@angular/cli/commands/serve.js:110:26)
    at process._tickCallback (internal/process/next_tick.js:109:7)

Desired functionality.

The code can be bootstraped without problem

Mention any other details that might be useful.

related #3540

mgechev commented 5 years ago

@e-cloud can you still reproduce this issue?

mgechev commented 5 years ago

Closing the issue due to inactivity. If the problem still exists in the latest version of the CLI, please open a new issue following the template and providing a minimal demo where we can reproduce it. Thanks! :-)

angular-automatic-lock-bot[bot] commented 5 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.