Useful or not, from you.
angular-cli Could not resolve entry .. in my angular-library.js

🐞 Bug report

- [ ] new
- [ ✔] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Is this a regression?

Not sure

Description

I'm unable to build angular library. Building my angular library with command ng build angular-library shows error:

BUILD ERROR Could not resolve entry (C:\Users..\angular-library\dist\esm2015\angular-library.js) Error: Could not resolve entry (C:\Users..\angular-library\dist\esm2015\angular-library.js) at error (C:\Users..\node_modules\rollup\dist\rollup.js:3598:30) at C:\Users..\node_modules\rollup\dist\rollup.js:18005:17

I've been struggling for hours, with no avail. I removed all usages of barrels in my library and made sure imports are correct. Error is not clear and doesn't tell me where to search for the issue.

🔬 Minimal Reproduction

command ng build angular-library

🔥 Exception or Error

<pre><code> Could not resolve entry (C:\Users..\angular-library\dist\esm2015\angular-library.js) Error: Could not resolve entry (C:\Users..\angular-library\dist\esm2015\angular-library.js) at error (C:\Users..\node_modules\rollup\dist\rollup.js:3598:30) at C:\Users..\node_modules\rollup\dist\rollup.js:18005:17

</code></pre>

🌍 Your Environment

<pre><code> Angular CLI: 7.3.5 Node: 10.15.1 OS: win32 x64 Angular: 7.2.7 ... animations, common, compiler, compiler-cli, core, forms ... http, language-service, platform-browser ... platform-browser-dynamic, platform-server, router

Package Version

@angular-devkit/architect 0.13.3 @angular-devkit/build-angular 0.13.3 @angular-devkit/build-ng-packagr 0.13.4 @angular-devkit/build-optimizer 0.13.3 @angular-devkit/build-webpack 0.13.3 @angular-devkit/core 7.3.3 @angular-devkit/schematics 7.3.5 @angular/cli 7.3.5 @ngtools/json-schema 1.1.0 @ngtools/webpack 7.3.3 @schematics/angular 7.3.5 @schematics/update 0.13.5 ng-packagr 5.0.1 rxjs 6.4.0 typescript 3.1.6 webpack 4.29.0 </code></pre>

That's a useful answer
Without any help

@alan-agius4 I am getting the same issue when building angular library. CLI 7.3.8

lib tsconfig:

{
  "extends": "../../tsconfig.json",
  "compilerOptions": {
    "outDir": "../../out-tsc/lib",
    "target": "es2015",
    "module": "esnext",
    "moduleResolution": "node",
    "declaration": true,
    "sourceMap": true,
    "inlineSources": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "importHelpers": true,
    "types": [],
    "lib": [
      "dom",
      "esnext"
    ]
  },
  "angularCompilerOptions": {
    "annotateForClosureCompiler": true,
    "skipTemplateCodegen": true,
    "strictMetadataEmit": true,
    "fullTemplateTypeCheck": true,
    "strictInjectionParameters": true,
    "flatModuleId": "AUTOGENERATED",
    "flatModuleOutFile": "AUTOGENERATED"
  },
  "exclude": [
    "src/test.ts",
    "**/*.spec.ts"
  ]
}

this is the error:

Error: Could not resolve entry (c:\Development\sds\core-ui-v1\dist\shared\esm2015\solar-log-shared.js)
    at error (c:\Development\sds\core-ui-v1\node_modules\rollup\dist\rollup.js:3766:30)
    at c:\Development\sds\core-ui-v1\node_modules\rollup\dist\rollup.js:18184:17

The problem is obvious when you look at the dist folder created by build: Capture