Skip to content

Angular 9.1.0 Fresh library project fails to build.  #17405

@niteshpurohit

Description

@niteshpurohit

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • xi18n
  • run
  • config
  • help
  • version
  • doc

Is this a regression?

Happen'd first time. Existing libraries updated to 9.1.0 builds without a problem.
But Newly created after i update CLI to 9.1.0 shows me above error on building. Building regular application works thou.

Description

Unable to build library project for freshly generated library project using cli 9.1.0

🔬 Minimal Reproduction

ng new my-lib-project --create-application=false
cd my-lib-project
ng generate library my-lib
ng build my-lib <=== ERROR

Repo: https://github.com/niteshpurohit/angular-cli-error-example-repo

🔥 Exception or Error


ng build my-lib

An unhandled exception occurred: Package exports for '**/my-lib-project/node_modules/ng-packagr/node_modules/rollup' do not define a valid '.' target
See "/private/var/folders/ln/_gz8v98j4dx0sv4zvm38_sw80000gn/T/ng-4DqbHq/angular-errors.log" for further details.

[error] Error: Package exports for **/my-lib-project/node_modules/ng-packagr/node_modules/rollup' do not define a valid '.' target
    at resolveExportsTarget (internal/modules/cjs/loader.js:545:13)
    at applyExports (internal/modules/cjs/loader.js:459:14)
    at resolveExports (internal/modules/cjs/loader.js:508:12)
    at Function.Module._findPath (internal/modules/cjs/loader.js:577:20)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:879:27)
    at Function.Module._load (internal/modules/cjs/loader.js:785:27)
    at Module.require (internal/modules/cjs/loader.js:956:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object. (/**/my-lib-project/node_modules/ng-packagr/lib/flatten/rollup.js:12:16)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)

🌍 Your Environment



     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 9.1.0
Node: 13.1.0
OS: darwin x64

Angular: 9.1.0
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Ivy Workspace: Yes

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.901.0
@angular-devkit/build-angular      0.901.0
@angular-devkit/build-ng-packagr   0.901.0
@angular-devkit/build-optimizer    0.901.0
@angular-devkit/build-webpack      0.901.0
@angular-devkit/core               9.1.0
@angular-devkit/schematics         9.1.0
@ngtools/webpack                   9.1.0
@schematics/angular                9.1.0
@schematics/update                 0.901.0
ng-packagr                         9.1.0
rxjs                               6.5.5
typescript                         3.8.3
webpack                            4.42.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions