Skip to content

Entry component has no internal name when imported via module file #9180

Closed

Description

@CrispyBacon12

Versions

Angular CLI: 1.6.3
Node: 8.9.4
OS: win32 x64
Angular: 5.2.0
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cli: 1.6.3
@angular-devkit/build-optimizer: 0.0.37
@angular-devkit/core: 0.0.24
@angular-devkit/schematics: 0.0.45
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.3
@schematics/angular: 0.1.12
typescript: 2.4.2
webpack: 3.10.0

Repro steps

sample repo: https://github.com/CrispyBacon12/has-no-internal-name

Observed behavior

ERROR in chunk main [initial]
[name].[chunkhash:20].bundle.js
The export "NavigatorComponent" in "C:/Users/Chris/Web/GitHub/repro/src/app/navigator/navigator.module.ts" has no internal name
Error: The export "NavigatorComponent" in "C:/Users/Chris/Web/GitHub/repro/src/app/navigator/navigator.module.ts" has no internal name
    at getFinalName (C:\Users\Chris\Web\GitHub\repro\node_modules\webpack\lib\optimize\ConcatenatedModule.js:60:13)
    at info.globalScope.through.forEach.reference (C:\Users\Chris\Web\GitHub\repro\node_modules\webpack\lib\optimize\ConcatenatedModule.js:582:25)
    at Array.forEach (<anonymous>)
    at modulesWithInfo.forEach.info (C:\Users\Chris\Web\GitHub\repro\node_modules\webpack\lib\optimize\ConcatenatedModule.js:569:30)
    at Array.forEach (<anonymous>)
    at ConcatenatedModule.source (C:\Users\Chris\Web\GitHub\repro\node_modules\webpack\lib\optimize\ConcatenatedModule.js:567:19)
    at ModuleTemplate.render (C:\Users\Chris\Web\GitHub\repro\node_modules\webpack\lib\ModuleTemplate.js:14:31)
    at C:\Users\Chris\Web\GitHub\repro\node_modules\webpack\lib\Template.js:116:28
    at Function.from (native)
    at Chunk.mapModules (C:\Users\Chris\Web\GitHub\repro\node_modules\webpack\lib\Chunk.js:163:16)
    at ChunkTemplate.renderChunkModules (C:\Users\Chris\Web\GitHub\repro\node_modules\webpack\lib\Template.js:113:26)
    at ChunkTemplate.render (C:\Users\Chris\Web\GitHub\repro\node_modules\webpack\lib\ChunkTemplate.js:16:30)
    at Compilation.createChunkAssets (C:\Users\Chris\Web\GitHub\repro\node_modules\webpack\lib\Compilation.js:1397:35)
    at sealPart2 (C:\Users\Chris\Web\GitHub\repro\node_modules\webpack\lib\Compilation.js:655:10)
    at next (C:\Users\Chris\Web\GitHub\repro\node_modules\tapable\lib\Tapable.js:202:11)
    at Compilation.compilation.plugin (C:\Users\Chris\Web\GitHub\repro\node_modules\webpack\lib\ProgressPlugin.js:111:6)

Desired behavior

Expected build not to fail under these conditions

Mention any other details that might be useful (optional)

  • This only occurs when using both --prod and AoT. Doing ng build --prod --aot false succeeds.
  • Either importing the component directly, or via a separate barrel file, does not cause an error. Only when importing via the same module file that it is being declared in.
  • No cyclic dependency warnings are shown, if that's the problem?
  • Thanks

Activity

  1. assigned and unassigned on Jan 15, 2018
  2. added
    P3
    on Jan 15, 2018
  3. filipesilva commented on Jan 15, 2018

    @filipesilva
    Contributor

    I think this is a simple counting bug. On AOT we elide (remove) unused imports when transforming files, and I think on the exports case we're counting times used wrong.

  4. added a commit that references this issue on Jan 16, 2018
    1648701
  5. added 3 commits that reference this issue on Jan 17, 2018
    b6f1be7
    86151ed
    f98bdaa
  6. added a commit that references this issue on Apr 23, 2018
    3d27846
  7. angular-automatic-lock-bot commented on Sep 7, 2019

    @angular-automatic-lock-bot

    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.

  8. locked and limited conversation to collaborators on Sep 7, 2019
  9. added a commit that references this issue on May 29, 2026
    cfd0691
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P3severity3: broken

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions