angular-cli: AOT import * error: ERROR in Illegal state: symbol without members expected, but got
Bug Report or Feature Request (mark with an x
)
- [x] bug report -> please search issues before submitting
- [ ] feature request
I did and search suggested to open new issue.
Versions.
node --version: v7.10.0 npm --version: 4.2.0 window 10 - 64bit
Repro steps.
Running command: webpack --env.aot --env.client & webpack --env.aot --env.server
from aspnetcore-angular2-universal.
When importing components/services with * I get error if any import also includes *.
For example this works:
//lazy.module.ts
import * as components from "./components/all";
//all.ts
import {SomeComponent} from "./some";
export {SomeComponent};
And this is not working:
//lazy.module.ts
import * as components from "./components/all";
//all.ts
import * as childs from "./childs"; //I THINK THIS CAUSE ERROR
import {SomeComponent} from "./some";
export {childs, SomeComponent};
//childs.ts
import {OtherComponent} from "./other";
export {OtherComponent};
The log given by the failure.
ERROR in Illegal state: symbol without members expected, but got {"filePath":"E:/test-project/trunk/test-project/Client/app/modules/lazy/components/all.ts","name":"childs","members":["OtherComponent"]}.
Desired functionality.
AOT compiles successfully.
Full error
ERROR in Illegal state: symbol without members expected, but got {"filePath":"E:/test-project/trunk/test-project/Client/app/modules/lazy/components/all.ts","name":"childs","members":["OtherComponent"]}.
ERROR in E:/test-project/trunk/test-project/Client/main.server.aot.ts (11,42): Cannot find module './ngfactory/app/server-app.module.ngfactory'.
ERROR in ./Client/main.server.aot.ts
Module not found: Error: Can't resolve './ngfactory/app/server-app.module.ngfactory' in 'E:\test-project\trunk\test-project\Client'
@ ./Client/main.server.aot.ts 7:0-87
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 10
- Comments: 18 (2 by maintainers)
Commits related to this issue
- https://github.com/angular/angular-cli/issues/6443 — committed to OysteinAmundsen/gymsystems by OysteinAmundsen 7 years ago
Is it the same?
Error: Illegal state: symbol without members expected, but got {“filePath”:“skipped/call-history/data/call-history-type.ts”,“name”:“CallHistoryType”,“members”:[“AllCalls”]}.
And callhistory-type.ts contains:
Appeared when I moved from 4.1.3 to 4.3.1 With 4.2.6 it compiles
same issue here using constants like
provided by a shared “util” module and used in various (lazy-loaded) modules, including routing modules
I may be confusing things here, but is this related to https://github.com/angular/angular/issues/18170?