Repository navigation
Closed
Description
Bug Report or Feature Request (mark with an x)
- [x] bug report -> please search issues before submitting
- [ ] feature request
Command (mark with an x)
- [ ] new
- [x] build
- [x] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc
Versions
node v8.9.4
npm 6.2.0
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ ??? \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 6.1.3
Node: 8.9.4
OS: win32 x64
Angular: 6.1.3
... animations, cli, common, compiler, compiler-cli, core, forms
... http, platform-browser, platform-browser-dynamic
... platform-server, router, service-worker
Package Version
------------------------------------------------------------
@angular-devkit/architect 0.7.3
@angular-devkit/build-angular 0.7.3
@angular-devkit/build-optimizer 0.7.3
@angular-devkit/build-webpack 0.7.3
@angular-devkit/core 0.7.3
@angular-devkit/schematics 0.7.3
@angular/cdk 6.4.1
@angular/flex-layout 6.0.0-beta.17
@angular/material 6.4.1
@angular/material-moment-adapter 6.4.1
@ngtools/webpack 6.1.3
@schematics/angular 0.7.3
@schematics/update 0.7.3
rxjs 6.2.2
typescript 2.9.2
webpack 4.9.2
Windows 10 (can't repro on Linux and MacOS)
Repro steps
ng build
The log given by the failure
Date: 2018-08-29T15:03:14.135Z
Hash: e414d3901afd066b8b88
Time: 13253ms
chunk {main} main.js, main.js.map (main) 1.93 kB [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 684 bytes [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 5.22 kB [entry] [rendered]
chunk {scripts} scripts.js, scripts.js.map (scripts) 249 kB [rendered]
chunk {styles} styles.js, styles.js.map (styles) 566 kB [initial] [rendered]chunk {vendor} vendor.js, vendor.js.map (vendor) 325 kB [initial] [rendered]
ERROR in ENOENT: no such file or directory, stat 'C:\C\code\##removed##\src\app\app.module.ts'
i 「wdm」: Failed to compile.
Desired functionality
Build app successfully
Mention any other details that might be useful
I found weird that the path logged in the error message mentions C drive twice ->"C:\C\code"
Project was originaly created in previous version of Angular and upgraded to ng6. Issue appeared after the migration to ng6
Workaround
I managed to compile my application if I change my file \src\app\index.ts from this
export { AppModule } from './app.module';
to this
export * from './app.module';
Activity
alan-agius4 commentedon Aug 30, 2018
This seems like a bug but we'll need to look at a reproduction to find and fix the problem. Can you setup a minimal repro please?
You can read here why this is needed. A good way to make a minimal repro is to create a new app via
ng new repro-appand adding the minimum possible code to show the problem. Then you can push this repository to github and link it here.This might be related to your directory structure so its really important to get an accurate repro to diagnose this.
aguerot commentedon Aug 30, 2018
I was hoping that the duplicated drive in path ("C:\C\code") would ring some bells.
I understand the need for repro-app, I'm going to try to setup a minimal repro-app and share asap.
aguerot commentedon Aug 30, 2018
You can clone this repo https://github.com/aguerot/angular-cli-issue-12035 for repro project
This is a barebone project generated w/
ng new repro-appwhere I added anindex.tsfile in app folder to exportAppModuleand updatedmain.tsto import fromimport { AppModule } from './app';instead ofimport { AppModule } from './app/app.module';see
app/index.tsfor offending code and workaround I foundfilipesilva commentedon Sep 3, 2018
I think this might be a problem with our barrel following logic.
fix(@ngtools/webpack): barrel files fail on windows
fix(@ngtools/webpack): barrel files fail on windows
angular-automatic-lock-bot commentedon Sep 8, 2019
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.
fix(@ngtools/webpack): barrel files fail on windows
fix(@ngtools/webpack): barrel files fail on windows