Skip to content

Import statements now case sensitive but in production / aot only #10732

@slubowsky

Description

@slubowsky

Upgraded to version 6. Production builds began failing. Eventually figured out cause was apparently newly introduced case sensitivity of import statements.

Versions

Angular CLI: 6.0.0
Node: 9.11.1
OS: win32 x64
Angular: 6.0.0
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.6.0
@angular-devkit/build-angular     0.6.0
@angular-devkit/build-optimizer   0.6.0
@angular-devkit/core              0.6.0
@angular-devkit/schematics        0.6.0
@ngtools/webpack                  6.0.0
@schematics/angular               0.6.0
@schematics/update                0.6.0
rxjs                              6.1.0
typescript                        2.7.2
webpack                           4.6.0

Repro steps

  • Use different case in directory names and / or file names then is used in import statement
    e.g directory is named

some-Form

import statement uses

some-form

  • ng serve --prod

Observed behavior

ERROR in : Cannot determine the module for class SomeFormComponent in D:/dev/my-app-clone2/src/app/my/shared-inputs/some-Form/some-form.component.ts! Add SomeFormComponent to the NgModule to fix it.

Desired behavior

  • Same behavior regardless of prod/aot or not
  • At least a more useful error message

Mention any other details that might be useful (optional)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions