Skip to content

Does not work with AOT #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
nekkon opened this issue Aug 10, 2017 · 2 comments
Open

Does not work with AOT #1

nekkon opened this issue Aug 10, 2017 · 2 comments

Comments

@nekkon
Copy link

nekkon commented Aug 10, 2017

Try building your examples with -prod flag. Also, you can not lazy load a shared module with this file/folder structure. There are open issues in angular-cli which need to be solved in order for your examples to work.

The errors thrown are:

ERROR in C:/Users/nekkon/Desktop/angular/intellix/src/red/$$_gendir/core/components/header/header.component.ngfactory.ts (11,21): Cannot find module './header.component'.
ERROR in C:/Users/nekkon/Desktop/angular/intellix/src/red/$$_gendir/core/core.module.ngfactory.ts (10,21): Cannot find module './core.module'.
ERROR in C:/Users/nekkon/Desktop/angular/intellix/src/red/$$_gendir/app/app.component.ngfactory.ts (11,21): Cannot find module '../../../core/components/header/header.component.ngfactory'.
ERROR in C:/Users/nekkon/Desktop/angular/intellix/src/red/$$_gendir/app/app.component.ngfactory.ts (11,21): Cannot find module '../../../core/components/header/header.component.ngfactory'.
ERROR in ./src/red/$$_gendir/app/app.component.ngfactory.ts
Module not found: Error: Can't resolve '../../../core/components/header/header.component.ngfactory' in 'C:\Users\nekkon\Desktop\angular\intellix\src\red$$_gendir\app'
resolve '../../../core/components/header/header.component.ngfactory' in 'C:\Users\nekkon\Desktop\angular\intellix\src\red$$_gendir\app'
using description file: C:\Users\nekkon\Desktop\angular\intellix\package.json (relative path: ./src/red/$$_gendir/app)
Field 'browser' doesn't contain a valid alias configuration
after using description file: C:\Users\nekkon\Desktop\angular\intellix\package.json (relative path: ./src/red/$$_gendir/app)
using description file: C:\Users\nekkon\Desktop\angular\intellix\package.json (relative path: ./src/core/components/header/header.component.ngfactory)
no extension
Field 'browser' doesn't contain a valid alias configuration
C:\Users\nekkon\Desktop\angular\intellix\src\core\components\header\header.component.ngfactory doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
C:\Users\nekkon\Desktop\angular\intellix\src\core\components\header\header.component.ngfactory.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
C:\Users\nekkon\Desktop\angular\intellix\src\core\components\header\header.component.ngfactory.js doesn't exist
as directory
C:\Users\nekkon\Desktop\angular\intellix\src\core\components\header\header.component.ngfactory doesn't exist
[C:\Users\nekkon\Desktop\angular\intellix\src\core\components\header\header.component.ngfactory]
[C:\Users\nekkon\Desktop\angular\intellix\src\core\components\header\header.component.ngfactory.ts]
[C:\Users\nekkon\Desktop\angular\intellix\src\core\components\header\header.component.ngfactory.js]
[C:\Users\nekkon\Desktop\angular\intellix\src\core\components\header\header.component.ngfactory]
@ ./src/red/$$_gendir/app/app.component.ngfactory.ts 9:0-81
@ ./src/red/$$_gendir/app/app.module.ngfactory.ts
@ ./src/red/main.ts
@ multi ./src/red/main.ts

@intellix
Copy link
Owner

intellix commented Aug 10, 2017

I got this earlier actually and assumed it was because I updated to 1.3.0 and needed to fix it. I did build at some point and must have broken it somewhere :) Will update when it's fixed.

Not sure I looked into the lazy loading stuff actually

@nekkon
Copy link
Author

nekkon commented Aug 10, 2017

I have made a branch that uses your code with a shared lazy loaded module. You can use it to test things (app blue) till they work properly. I have also added you as a contributor so feel free to improve angular-cli-library. Thanks for your help so far. I explain everything here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants